===================================================================
@@ -3112,7 +3112,9 @@ push_class_level_binding_1 (tree name, tree x)
if (!class_binding_level)
return true;
- if (name == error_mark_node)
+ if (name == error_mark_node
+ /* Can happen for an erroneous declaration (c++/60384). */
+ || !identifier_p (name))
return false;
/* Check for invalid member names. But don't worry about a default
===================================================================
@@ -0,0 +1,9 @@
+// PR c++/60384
+// { dg-do compile { target c++1y } }
+
+template<typename> int foo();
+
+struct A
+{
+ typedef auto foo<>(); // { dg-error "typedef declared 'auto'" }
+};