Add test for PR c++/92443.
authorMarek Polacek <polacek@redhat.com>
Wed, 20 Nov 2019 22:59:20 +0000 (22:59 +0000)
committerMarek Polacek <mpolacek@gcc.gnu.org>
Wed, 20 Nov 2019 22:59:20 +0000 (22:59 +0000)
* g++.dg/cpp0x/constexpr-92443.C: New test.

From-SVN: r278534

gcc/testsuite/ChangeLog
gcc/testsuite/g++.dg/cpp0x/constexpr-92443.C [new file with mode: 0644]

index 99949be..eb33e63 100644 (file)
@@ -1,3 +1,8 @@
+2019-11-20  Marek Polacek  <polacek@redhat.com>
+
+       PR c++/92443
+       * g++.dg/cpp0x/constexpr-92443.C: New test.
+
 2019-11-20  Richard Sandiford  <richard.sandiford@arm.com>
 
        PR testsuite/92366
diff --git a/gcc/testsuite/g++.dg/cpp0x/constexpr-92443.C b/gcc/testsuite/g++.dg/cpp0x/constexpr-92443.C
new file mode 100644 (file)
index 0000000..8d03e3e
--- /dev/null
@@ -0,0 +1,12 @@
+// PR c++/92443
+// { dg-do compile { target c++11 } }
+
+struct a {
+  constexpr a(long) : b() {}
+  operator long() const;
+  operator bool();
+  constexpr friend a operator|(a, a c) { return c; }
+  long b;
+};
+using d = a;
+constexpr d e = 6, f = f | e;