Commit 0bcd172d by Jason Merrill Committed by Jason Merrill

PR c++/78767 - ICE with inherited constructor default argument

	* method.c (strip_inheriting_ctors): Strip template as appropriate.

From-SVN: r243864
parent 3a8f9451
2016-12-21 Jason Merrill <jason@redhat.com> 2016-12-21 Jason Merrill <jason@redhat.com>
PR c++/78767 - ICE with inherited constructor default argument
* method.c (strip_inheriting_ctors): Strip template as appropriate.
PR c++/78749 - friend in anonymous namespace PR c++/78749 - friend in anonymous namespace
* decl.c (wrapup_globals_for_namespace): Don't complain about friend * decl.c (wrapup_globals_for_namespace): Don't complain about friend
pseudo-template instantiations. pseudo-template instantiations.
......
...@@ -496,14 +496,18 @@ forward_parm (tree parm) ...@@ -496,14 +496,18 @@ forward_parm (tree parm)
constructor from a (possibly indirect) base class. */ constructor from a (possibly indirect) base class. */
tree tree
strip_inheriting_ctors (tree fn) strip_inheriting_ctors (tree dfn)
{ {
gcc_assert (flag_new_inheriting_ctors); gcc_assert (flag_new_inheriting_ctors);
tree fn = dfn;
while (tree inh = DECL_INHERITED_CTOR (fn)) while (tree inh = DECL_INHERITED_CTOR (fn))
{ {
inh = OVL_CURRENT (inh); inh = OVL_CURRENT (inh);
fn = inh; fn = inh;
} }
if (TREE_CODE (fn) == TEMPLATE_DECL
&& TREE_CODE (dfn) == FUNCTION_DECL)
fn = DECL_TEMPLATE_RESULT (fn);
return fn; return fn;
} }
......
// 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);
Markdown is supported
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