]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
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:06:15 +0000 (09:06 +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 8536c83b48023599765c5deca4217d93b3ab6a6f..86bc08d4bb78540d88f5f242818b7315304af560 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  Christophe Lyon  <christophe.lyon@linaro.org>
 
        Backport from mainline
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{};
+}