2005-02-14 Nathan Sidwell <nathan@codesourcery.com>
+ PR c++/19608
+ * parser.c (cp_parser_late_parsing_for_member): Use
+ current_function_decl as scope to push to and from.
+
PR c++/19884
* pt.c (check_explicit_specialization): Make sure namespace
binding lookup found an overloaded function.
tokens = DECL_PENDING_INLINE_INFO (member_function);
DECL_PENDING_INLINE_INFO (member_function) = NULL;
DECL_PENDING_INLINE_P (member_function) = 0;
- /* If this was an inline function in a local class, enter the scope
- of the containing function. */
- function_scope = decl_function_context (member_function);
+
+ /* If this is a local class, enter the scope of the containing
+ function. */
+ function_scope = current_function_decl;
if (function_scope)
push_function_context_to (function_scope);
2005-02-14 Nathan Sidwell <nathan@codesourcery.com>
+ PR c++/19608
+ * g++.dg/parse/local-class1.C: New.
+
PR c++/19895
* g++.dg/parse/ptrmem3.C: New.
--- /dev/null
+ // Copyright (C) 2005 Free Software Foundation, Inc.
+// Contributed by Nathan Sidwell 14 Feb 2005 <nathan@codesourcery.com>
+
+// Origin: Jorn Wolfgang Rennecke <amylaar@gcc.gnu.org>
+// Bug 19608: ICE on invalid
+
+
+void f ()
+{
+ class c
+ {
+ friend void g () { } // { dg-error "local class definition" "" }
+ };
+}