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.
Loading
Please register or sign in to comment