* pt.c (dguide_name_p): Check for IDENTIFIER_NODE.
From-SVN: r257706
2018-02-15 Jason Merrill <jason@redhat.com>
+ 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.
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)));
}
--- /dev/null
+// PR c++/84376
+
+template<int> struct A {};
+
+template<typename T> T foo() { return T(); }
+
+template<> A foo<A>(); // { dg-error "A" }