From: Jakub Jelinek Date: Wed, 26 Feb 2020 08:04:44 +0000 (+0100) Subject: c++: Fix rejects-valid bug in cxx_eval_outermost_constant_expr [PR93905] X-Git-Tag: releases/gcc-9.3.0~81 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=c6b81c451983f1b9a6e184f137819abf4978eddd;p=thirdparty%2Fgcc.git c++: Fix rejects-valid bug in cxx_eval_outermost_constant_expr [PR93905] Add testcase for a bug that has been just on the 8 branch. 2020-02-26 Jakub Jelinek PR c++/93905 * g++.dg/cpp0x/pr93905.C: New test. --- diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index 8536c83b4802..86bc08d4bb78 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,8 @@ +2020-02-26 Jakub Jelinek + + PR c++/93905 + * g++.dg/cpp0x/pr93905.C: New test. + 2020-02-25 Christophe Lyon 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 index 000000000000..81c6266a795a --- /dev/null +++ b/gcc/testsuite/g++.dg/cpp0x/pr93905.C @@ -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{}; +}