PR c++/60312
* parser.c (cp_parser_template_type_arg): Check for invalid 'auto'.
From-SVN: r208092
+2014-02-24 Jason Merrill <jason@redhat.com>
+
+ PR c++/60312
+ * parser.c (cp_parser_template_type_arg): Check for invalid 'auto'.
+
2014-02-21 Jason Merrill <jason@redhat.com>
PR c++/58170
= G_("types may not be defined in template arguments");
r = cp_parser_type_id_1 (parser, true, false);
parser->type_definition_forbidden_message = saved_message;
+ if (cxx_dialect >= cxx1y && type_uses_auto (r))
+ {
+ error ("invalid use of %<auto%> in template argument");
+ r = error_mark_node;
+ }
return r;
}
--- /dev/null
+// PR c++/60312
+// { dg-options -std=c++1y }
+
+template<typename> struct A;
+
+template<> struct A<auto> // { dg-error "auto|template argument" }
+{
+ template<int> void foo();
+};
+
+void bar()
+{
+ A<auto>().foo<0>(); // { dg-error "auto|template argument" }
+}
+
+// { dg-prune-output "expected" }