+2005-01-19 Kriang Lerdsuwanakij <lerdsuwa@users.sourceforge.net>
+
+ PR c++/19258
+ * parser.c (cp_parser_late_parsing_default_args): Handle friend
+ defined in class.
+ * pt.c (push_access_scope, pop_access_scope): Likewise.
+
2005-01-15 Jakub Jelinek <jakub@redhat.com>
PR c++/19263
/* C++ Parser.
- Copyright (C) 2000, 2001, 2002, 2003, 2004 Free Software Foundation, Inc.
+ Copyright (C) 2000, 2001, 2002, 2003, 2004,
+ 2005 Free Software Foundation, Inc.
Written by Mark Mitchell <mark@codesourcery.com>.
This file is part of GCC.
saved_local_variables_forbidden_p = parser->local_variables_forbidden_p;
parser->local_variables_forbidden_p = true;
/* Parse the assignment-expression. */
- if (DECL_CLASS_SCOPE_P (fn))
+ if (DECL_FRIEND_CONTEXT (fn))
+ push_nested_class (DECL_FRIEND_CONTEXT (fn));
+ else if (DECL_CLASS_SCOPE_P (fn))
push_nested_class (DECL_CONTEXT (fn));
TREE_PURPOSE (parameters) = cp_parser_assignment_expression (parser);
- if (DECL_CLASS_SCOPE_P (fn))
+ if (DECL_FRIEND_CONTEXT (fn) || DECL_CLASS_SCOPE_P (fn))
pop_nested_class ();
/* If the token stream has not been completely used up, then
/* Handle parameterized types (templates) for GNU C++.
Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000,
- 2001, 2002, 2003, 2004 Free Software Foundation, Inc.
+ 2001, 2002, 2003, 2004, 2005 Free Software Foundation, Inc.
Written by Ken Raeburn (raeburn@cygnus.com) while at Watchmaker Computing.
Rewritten by Jason Merrill (jason@cygnus.com).
|| TREE_CODE (t) == VAR_DECL,
0);
- if (DECL_CLASS_SCOPE_P (t))
+ if (DECL_FRIEND_CONTEXT (t))
+ push_nested_class (DECL_FRIEND_CONTEXT (t));
+ else if (DECL_CLASS_SCOPE_P (t))
push_nested_class (DECL_CONTEXT (t));
else
push_to_top_level ();
saved_access_scope = TREE_CHAIN (saved_access_scope);
}
- if (DECL_CLASS_SCOPE_P (t))
+ if (DECL_FRIEND_CONTEXT (t) || DECL_CLASS_SCOPE_P (t))
pop_nested_class ();
else
pop_from_top_level ();
+2005-01-19 Kriang Lerdsuwanakij <lerdsuwa@users.sourceforge.net>
+
+ PR c++/19258
+ * g++.dg/lookup/friend6.C: New test.
+
2005-01-19 Jakub Jelinek <jakub@redhat.com>
PR rtl-optimization/15139