Commit 346ab5a5 authored by Jason Merrill's avatar Jason Merrill
Browse files

c++: delayed parse DMI [PR96645]

With the changes for PR81359 and PR88368 to make get_nsdmi errors be treated
as substitution failure, we have the problem that if we check
std::is_default_constructible for a complete class that still has unparsed
default member initializers, we get an answer (false) that will be wrong
once the DMIs have been parsed.  The traits avoid this problem for regular
incomplete classes by giving an error if the operand is incomplete; we
should do the same if get_nsdmi is going to fail due to unparsed DMI.

	PR c++/96645

gcc/cp/ChangeLog:

	* cp-tree.h (type_has_default_ctor_to_be_synthesized): Declare.
	* class.cc (type_has_default_ctor_to_be_synthesized): New.
	(type_has_non_user_provided_default_constructor_1): Support it.
	(type_has_non_user_provided_default_constructor): Now a wrapper.
	* method.cc (complain_about_unparsed_dmi): New.
	(constructible_expr): Call it.

gcc/testsuite/ChangeLog:

	* g++.dg/ext/is_constructible3.C: Expect error.
	* g++.dg/ext/is_constructible7.C: New test.
parent f0530882
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment