Fix PR c++/60626
PR c++/60626
* parser.c (cp_parser_init_declarator): Handle erroneous generic type
usage in non-functions with pushed scope.
PR c++/60626
* g++.dg/cpp1y/pr60626.C: New testcase.
From-SVN: r208940
+2014-03-29 Adam Butcher <adam@jessamine.co.uk>
+
+ PR c++/60626
+ * parser.c (cp_parser_init_declarator): Handle erroneous generic type
+ usage in non-functions with pushed scope.
+
2014-03-28 Adam Butcher <adam@jessamine.co.uk>
PR c++/60573
been issued. */
if (parser->fully_implicit_function_template_p)
if (!function_declarator_p (declarator))
- finish_fully_implicit_template (parser, /*member_decl_opt=*/0);
+ {
+ if (pushed_scope)
+ {
+ pop_scope (pushed_scope);
+ pushed_scope = 0;
+ }
+ finish_fully_implicit_template (parser, /*member_decl_opt=*/0);
+ }
/* For an in-class declaration, use `grokfield' to create the
declaration. */
+2014-03-29 Adam Butcher <adam@jessamine.co.uk>
+
+ PR c++/60626
+ * g++.dg/cpp1y/pr60626.C: New testcase.
+
2014-03-29 Joseph Myers <joseph@codesourcery.com>
* gcc.dg/pr45416.c: Allow bextr on x86.
--- /dev/null
+// PR c++/60626
+// { dg-do compile { target c++1y } }
+// { dg-options "" }
+
+struct A {};
+
+void (*A::p)(auto) = 0; // { dg-error "static member|non-template" }