aboutsummaryrefslogtreecommitdiff
path: root/gcc/testsuite/g++.dg/cpp2a/spaceship-constexpr1.C
diff options
context:
space:
mode:
Diffstat (limited to 'gcc/testsuite/g++.dg/cpp2a/spaceship-constexpr1.C')
-rw-r--r--gcc/testsuite/g++.dg/cpp2a/spaceship-constexpr1.C15
1 files changed, 15 insertions, 0 deletions
diff --git a/gcc/testsuite/g++.dg/cpp2a/spaceship-constexpr1.C b/gcc/testsuite/g++.dg/cpp2a/spaceship-constexpr1.C
new file mode 100644
index 0000000..9d008f1
--- /dev/null
+++ b/gcc/testsuite/g++.dg/cpp2a/spaceship-constexpr1.C
@@ -0,0 +1,15 @@
+// { dg-do compile { target c++2a } }
+
+struct A
+{
+ int i;
+ bool operator==(A a) const { return i == a.i; }
+};
+
+struct B
+{
+ A a;
+ bool operator==(const B&) const = default; // { dg-error "A::operator==" }
+};
+
+constexpr bool x = B() == B(); // { dg-error "non-.constexpr" }