]>
gcc.gnu.org Git - gcc.git/commit - gcc/cp/constexpr.cc
c++: Reject identifier label in constexpr [PR97846]
[dcl.constexpr]/3 says that the function-body of a constexpr function
shall not contain an identifier label, but we aren't enforcing that.
This patch implements that. Of course, we can't reject artificial
labels.
gcc/cp/ChangeLog:
PR c++/97846
* constexpr.c (potential_constant_expression_1): Reject
LABEL_EXPRs that use non-artifical LABEL_DECLs.
gcc/testsuite/ChangeLog:
PR c++/97846
* g++.dg/cpp1y/constexpr-label.C: New test.
This page took 0.050255 seconds and 5 git commands to generate.