public inbox for gcc-cvs@sourceware.org
help / color / mirror / Atom feed
* [gcc r11-8158] testsuite: Add testcase for already fixed PR97121
@ 2021-04-13 18:43 Jakub Jelinek
  0 siblings, 0 replies; only message in thread
From: Jakub Jelinek @ 2021-04-13 18:43 UTC (permalink / raw)
  To: gcc-cvs

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'" }
+}


^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2021-04-13 18:43 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-04-13 18:43 [gcc r11-8158] testsuite: Add testcase for already fixed PR97121 Jakub Jelinek

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).