public inbox for gcc-cvs@sourceware.org
help / color / mirror / Atom feed
From: Jakub Jelinek <jakub@gcc.gnu.org>
To: gcc-cvs@gcc.gnu.org
Subject: [gcc r11-8158] testsuite: Add testcase for already fixed PR97121
Date: Tue, 13 Apr 2021 18:43:25 +0000 (GMT)	[thread overview]
Message-ID: <20210413184325.CF2913950C4D@sourceware.org> (raw)

https://gcc.gnu.org/g:4df918798b445e86305b63f86f5312a18e4017c5

commit r11-8158-g4df918798b445e86305b63f86f5312a18e4017c5
Author: Jakub Jelinek <jakub@redhat.com>
Date:   Tue Apr 13 20:42:07 2021 +0200

    testsuite: Add testcase for already fixed PR97121
    
    This was fixed by r11-5866 aka PR96299 fix.
    
    2021-04-13  Jakub Jelinek  <jakub@redhat.com>
    
            PR c++/97121
            * g++.dg/cpp2a/spaceship-err6.C: New test.

Diff:
---
 gcc/testsuite/g++.dg/cpp2a/spaceship-err6.C | 20 ++++++++++++++++++++
 1 file changed, 20 insertions(+)

diff --git a/gcc/testsuite/g++.dg/cpp2a/spaceship-err6.C b/gcc/testsuite/g++.dg/cpp2a/spaceship-err6.C
new file mode 100644
index 00000000000..57fbdb33088
--- /dev/null
+++ b/gcc/testsuite/g++.dg/cpp2a/spaceship-err6.C
@@ -0,0 +1,20 @@
+// PR c++/97121
+// { dg-do compile { target c++20 } }
+
+#include <compare>
+
+class MyClass
+{
+  int mValue;	// { dg-error "three-way comparison of 'MyClass::mValue' has type 'std::strong_ordering', which does not convert to 'bool'" }
+
+public:
+  MyClass(int value): mValue(value) {}
+
+  bool operator<=>(const MyClass&) const = default;
+};
+
+int main()
+{
+  MyClass a = 10, b = 15;
+  return (a < b);	// { dg-error "use of deleted function 'constexpr bool MyClass::operator<=>\\\(const MyClass&\\\) const'" }
+}


                 reply	other threads:[~2021-04-13 18:43 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20210413184325.CF2913950C4D@sourceware.org \
    --to=jakub@gcc.gnu.org \
    --cc=gcc-cvs@gcc.gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).