Skip to content
Snippets Groups Projects
Commit 6f20c42c authored by Marek Polacek's avatar Marek Polacek
Browse files

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.
parent 0999f260
No related branches found
No related tags found
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment