Skip to content
Snippets Groups Projects
Commit beb019d3 authored by Jason Merrill's avatar Jason Merrill
Browse files

c++: Constant expression parsing and parameters.

The difference between a "potential" constant-expression and a regular
constant-expression is the treatment of parameters; in a constexpr function,
a parameter is potentially constant when evaluating a call to that function,
but it is not constant during parsing of the function.
cp_parser_constant_expression should check the latter rather than the
former.

gcc/cp/ChangeLog:

	* cp-tree.h (is_rvalue_constant_expression): Declare.
	* constexpr.c (is_rvalue_constant_expression): New.
	* parser.c (cp_parser_constant_expression): Use it.
	* decl.c (cp_finish_decl): Try to treat a constexpr initializer in a
	template as constant.
parent 4f602147
No related branches found
No related tags found
No related merge requests found
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