aboutsummaryrefslogtreecommitdiff
path: root/gcc/cp/method.c
diff options
context:
space:
mode:
authorJason Merrill <jason@redhat.com>2016-12-21 14:10:23 -0500
committerJason Merrill <jason@gcc.gnu.org>2016-12-21 14:10:23 -0500
commit0bcd172dbf4f3d9168d4436e5f34730b8987762a (patch)
treecda65b7572553c9bd570bf51db6ad0581a3b6f6a /gcc/cp/method.c
parent3a8f9451d9bd8d00ca0bb0d9ca45c54f794600e5 (diff)
downloadgcc-0bcd172dbf4f3d9168d4436e5f34730b8987762a.zip
gcc-0bcd172dbf4f3d9168d4436e5f34730b8987762a.tar.gz
gcc-0bcd172dbf4f3d9168d4436e5f34730b8987762a.tar.bz2
PR c++/78767 - ICE with inherited constructor default argument
* method.c (strip_inheriting_ctors): Strip template as appropriate. From-SVN: r243864
Diffstat (limited to 'gcc/cp/method.c')
-rw-r--r--gcc/cp/method.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/gcc/cp/method.c b/gcc/cp/method.c
index 73d42b1..a5271a4 100644
--- a/gcc/cp/method.c
+++ b/gcc/cp/method.c
@@ -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;
}