From: Jason Merrill Date: Thu, 15 Feb 2018 19:46:13 +0000 (-0500) Subject: PR c++/84376 - ICE with omitted template arguments. X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=117ad0be08050242d0235b586dc431038f04dcf0;p=gcc.git PR c++/84376 - ICE with omitted template arguments. * pt.c (dguide_name_p): Check for IDENTIFIER_NODE. From-SVN: r257706 --- diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog index 5ecc8ab2672..58073748315 100644 --- a/gcc/cp/ChangeLog +++ b/gcc/cp/ChangeLog @@ -1,5 +1,8 @@ 2018-02-15 Jason Merrill + PR c++/84376 - ICE with omitted template arguments. + * pt.c (dguide_name_p): Check for IDENTIFIER_NODE. + PR c++/84368 - wrong error with local variable in variadic lambda. * pt.c (tsubst_pack_expansion): Fix handling of non-packs in local_specializations. diff --git a/gcc/cp/pt.c b/gcc/cp/pt.c index cd1aed8d677..268cfe5a454 100644 --- a/gcc/cp/pt.c +++ b/gcc/cp/pt.c @@ -25454,7 +25454,8 @@ dguide_name (tree tmpl) bool dguide_name_p (tree name) { - return (TREE_TYPE (name) + return (TREE_CODE (name) == IDENTIFIER_NODE + && TREE_TYPE (name) && !strncmp (IDENTIFIER_POINTER (name), dguide_base, strlen (dguide_base))); } diff --git a/gcc/testsuite/g++.dg/cpp1z/class-deduction47.C b/gcc/testsuite/g++.dg/cpp1z/class-deduction47.C new file mode 100644 index 00000000000..3e47f58e698 --- /dev/null +++ b/gcc/testsuite/g++.dg/cpp1z/class-deduction47.C @@ -0,0 +1,7 @@ +// PR c++/84376 + +template struct A {}; + +template T foo() { return T(); } + +template<> A foo(); // { dg-error "A" }