PR c++/64222
* parser.c (cp_parser_unqualified_id): Don't declare fname while
parsing function parms.
From-SVN: r218556
+2014-12-09 Jason Merrill <jason@redhat.com>
+
+ PR c++/64222
+ * parser.c (cp_parser_unqualified_id): Don't declare fname while
+ parsing function parms.
+
2014-12-03 Jason Merrill <jason@redhat.com>
PR c++/64029
case RID_PRETTY_FUNCTION_NAME:
case RID_C99_FUNCTION_NAME:
cp_lexer_consume_token (parser->lexer);
- finish_fname (token->u.value);
+ /* Don't try to declare this while tentatively parsing a function
+ declarator, as cp_make_fname_decl will fail. */
+ if (current_binding_level->kind != sk_function_parms)
+ finish_fname (token->u.value);
return token->u.value;
default:
--- /dev/null
+// PR c++/64222
+
+class A
+{
+public:
+ A (const char *, void *);
+};
+class B
+{
+public:
+ B (A);
+};
+void
+fn1 ()
+{
+ B a (A (__func__, 0));
+}