https://gcc.gnu.org/bugzilla/show_bug.cgi?id=93314
--- Comment #11 from CVS Commits ---
The releases/gcc-11 branch has been updated by Jason Merrill
:
https://gcc.gnu.org/g:b786dafe9eb933f23686c68c6d7110fef5656985
commit r11-8430-gb786dafe9eb933f23686c68c6d7110fef5656985
Author: Jason Merrill
Date: Wed Apr 14 11:24:50 2021 -0400
c++: constant expressions are evaluated [PR93314]
My GCC 11 patch for PR93314 turned off cp_unevaluated_operand while
processing an id-expression that names a non-static data member, but the
broader issue is that in general, a constant-expression is evaluated even
in
an unevaluated operand.
This also fixes 100205, introduced by the earlier patch that couldn't
distinguish between the different allow_non_constant_p cases.
PR c++/100205
PR c++/93314
gcc/cp/ChangeLog:
* cp-tree.h (cp_evaluated): Add reset parm to constructor.
* parser.c (cp_parser_constant_expression): Change
allow_non_constant_p to int. Use cp_evaluated.
(cp_parser_initializer_clause): Pass 2 to allow_non_constant_p.
* semantics.c (finish_id_expression_1): Don't mess with
cp_unevaluated_operand here.
gcc/testsuite/ChangeLog:
* g++.dg/cpp0x/decltype-nonstatic1.C: New test.