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

c++: fix ICE with is_really_empty_class [PR110106]

is_really_empty_class is liable to crash when it gets an incomplete
or dependent type.  Since r11-557, we pass the yet-uninstantiated
class type S<0> of the PARM_DECL s to is_really_empty_class -- because
of the potential_rvalue_constant_expression -> is_rvalue_constant_expression
change in cp_parser_constant_expression.  Here we're not parsing
a template so we did not check COMPLETE_TYPE_P as we should.

It should work to complete the type before checking COMPLETE_TYPE_P.

	PR c++/110106

gcc/cp/ChangeLog:

	* constexpr.cc (potential_constant_expression_1): Try to complete the
	type when !processing_template_decl.

gcc/testsuite/ChangeLog:

	* g++.dg/cpp0x/noexcept80.C: New test.

(cherry picked from commit e36d1994)
parent 60979215
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