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

c++: inherited default constructor [CWG2799]

In this testcase, it seems clear that B should be trivially
default-constructible, since the inherited default constructor is trivial
and there are no other subobjects to initialize.  But we were saying no
because we don't define triviality of inherited constructors.

CWG discussion suggested that the solution is to implicitly declare a
default constructor when inheriting a default constructor; that makes sense
to me.

	DR 2799

gcc/cp/ChangeLog:

	* class.cc (add_implicit_default_ctor): Split out...
	(add_implicitly_declared_members): ...from here.
	Also call it when inheriting a default ctor.

gcc/testsuite/ChangeLog:

	* g++.dg/cpp0x/inh-ctor38.C: New test.
parent bf6b107e
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