@@ -496,14 +496,18 @@ forward_parm (tree parm)
constructor from a (possibly indirect) base class. */
tree
-strip_inheriting_ctors (tree fn)
+strip_inheriting_ctors (tree dfn)
{
gcc_assert (flag_new_inheriting_ctors);
+ tree fn = dfn;
while (tree inh = DECL_INHERITED_CTOR (fn))
{
inh = OVL_CURRENT (inh);
fn = inh;
}
+ if (TREE_CODE (fn) == TEMPLATE_DECL
+ && TREE_CODE (dfn) == FUNCTION_DECL)
+ fn = DECL_TEMPLATE_RESULT (fn);
return fn;
}
new file mode 100644
@@ -0,0 +1,15 @@
+// PR c++/78767
+// { dg-do compile { target c++11 } }
+
+template <class T> struct A
+{
+ template <class U>
+ A(U, U = 42);
+};
+
+struct B: A<int>
+{
+ using A::A;
+};
+
+B b(24);