c++: Fix rejects-valid bug in cxx_eval_outermost_constant_expr [PR93905]
authorJakub Jelinek <jakub@redhat.com>
Wed, 26 Feb 2020 08:04:44 +0000 (09:04 +0100)
committerJakub Jelinek <jakub@redhat.com>
Wed, 26 Feb 2020 08:04:44 +0000 (09:04 +0100)
Add testcase for a bug that has been just on the 8 branch.

2020-02-26  Jakub Jelinek  <jakub@redhat.com>

PR c++/93905
* g++.dg/cpp0x/pr93905.C: New test.

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

index f34437641967f0240036e2ee905d7ded30f05165..217c3600b1b8df7f2c155a78b46b61383e0b7979 100644 (file)
@@ -1,3 +1,8 @@
+2020-02-26  Jakub Jelinek  <jakub@redhat.com>
+
+       PR c++/93905
+       * g++.dg/cpp0x/pr93905.C: New test.
+
 2020-02-25  Mihail Ionescu  <mihail.ionescu@arm.com>
 
        * gcc.target/aarch64/advsimd-intrinsics/bf16_vstn.c: New test.
diff --git a/gcc/testsuite/g++.dg/cpp0x/pr93905.C b/gcc/testsuite/g++.dg/cpp0x/pr93905.C
new file mode 100644 (file)
index 0000000..81c6266
--- /dev/null
@@ -0,0 +1,18 @@
+// PR c++/93905
+// { dg-do compile { target c++11 } }
+
+enum class E { VALUE };
+
+struct B {
+  E e{E::VALUE};
+protected:
+  ~B () = default;  
+};
+
+struct D : B {};
+
+int
+main ()
+{
+  D d{};
+}