scope whenever a template parameter list has been started, independent
of whether the function call operator was well-formed or not.
+ PR c++/60064
+ * parser.c (cp_parser_member_declaration): Pop fully implicit template
+ scope for generic friend declarations as well as for non-friends.
+
2014-02-12 Paolo Carlini <paolo.carlini@oracle.com>
PR c++/60047
&decl_specifiers,
declarator,
attributes);
+ if (parser->fully_implicit_function_template_p)
+ decl = finish_fully_implicit_template (parser, decl);
/* If the member was not a friend, declare it here. */
if (!friend_p)
- {
- if (parser->fully_implicit_function_template_p)
- decl = finish_fully_implicit_template (parser, decl);
- finish_member_declaration (decl);
- }
+ finish_member_declaration (decl);
/* Peek at the next token. */
token = cp_lexer_peek_token (parser->lexer);
/* If the next token is a semicolon, consume it. */
--- /dev/null
+// PR c++/60064
+// { dg-do compile }
+// { dg-options "-std=c++1y" }
+
+class A
+{
+ int m;
+ friend void foo (auto) {}
+ friend void foo2 (auto);
+};
+
+void foo2 (auto i)
+{
+ A a;
+ a.m = i;
+}
+
+int main ()
+{
+ foo2 (7);
+}