@@ -3453,8 +3453,19 @@ add_implicitly_declared_members (tree t,
location_t loc = input_location;
input_location = DECL_SOURCE_LOCATION (using_decl);
if (ctor_list)
- for (; ctor_list; ctor_list = OVL_NEXT (ctor_list))
- one_inherited_ctor (OVL_CURRENT (ctor_list), t, using_decl);
+ {
+ if (cxx_dialect >= cxx1z)
+ {
+ /* [dcl.init.aggr]/1: An aggregate is an array or a class
+ with
+ - no user-provided, explicit or inherited
+ constructors. */
+ CLASSTYPE_NON_AGGREGATE (t) = 1;
+ CLASSTYPE_NON_LAYOUT_POD_P (t) = 1;
+ }
+ for (; ctor_list; ctor_list = OVL_NEXT (ctor_list))
+ one_inherited_ctor (OVL_CURRENT (ctor_list), t, using_decl);
+ }
*access_decls = TREE_CHAIN (*access_decls);
input_location = loc;
}
@@ -0,0 +1,28 @@
+// PR c++/79143
+// { dg-do compile }
+// { dg-options "-std=c++1z" }
+
+struct base {
+ base (int, int) {}
+};
+
+template<class>
+struct derived : base {
+ using base::base;
+};
+
+template<class>
+struct derived2 : base {
+ derived2 (int x, int y) : base (x, y) {}
+};
+
+int
+main ()
+{
+ base (13, 42);
+ derived<int> (13, 42);
+ derived2<int> (13, 42);
+ base{13, 42};
+ derived<int>{13, 42}; // { dg-bogus "too many initializers" }
+ derived2<int>{13, 42};
+}