Commit 7f701cc1 by Nathan Froyd Committed by Nathan Froyd

decl.c (grokmethod): Test DECL_CLASS_SCOPE_P.

	* decl.c (grokmethod): Test DECL_CLASS_SCOPE_P.
	* error.c (dump_decl): Test DECL_FILE_SCOPE_P.

From-SVN: r167691
parent 97ce54b9
2010-12-10 Nathan Froyd <froydnj@codesourcery.com> 2010-12-10 Nathan Froyd <froydnj@codesourcery.com>
* decl.c (grokmethod): Test DECL_CLASS_SCOPE_P.
* error.c (dump_decl): Test DECL_FILE_SCOPE_P.
2010-12-10 Nathan Froyd <froydnj@codesourcery.com>
* cp-tree.h (readonly_error_kind): Delete. * cp-tree.h (readonly_error_kind): Delete.
(readonly_error): Rename to... (readonly_error): Rename to...
(cxx_readonly_error): ...this. Change second argument to be an (cxx_readonly_error): ...this. Change second argument to be an
......
...@@ -13098,8 +13098,7 @@ grokmethod (cp_decl_specifier_seq *declspecs, ...@@ -13098,8 +13098,7 @@ grokmethod (cp_decl_specifier_seq *declspecs,
if (DECL_IN_AGGR_P (fndecl)) if (DECL_IN_AGGR_P (fndecl))
{ {
if (DECL_CONTEXT (fndecl) if (DECL_CLASS_SCOPE_P (fndecl))
&& TREE_CODE (DECL_CONTEXT (fndecl)) != NAMESPACE_DECL)
error ("%qD is already defined in class %qT", fndecl, error ("%qD is already defined in class %qT", fndecl,
DECL_CONTEXT (fndecl)); DECL_CONTEXT (fndecl));
return error_mark_node; return error_mark_node;
......
...@@ -1027,7 +1027,7 @@ dump_decl (tree t, int flags) ...@@ -1027,7 +1027,7 @@ dump_decl (tree t, int flags)
dump_type (DECL_CONTEXT (t), flags); dump_type (DECL_CONTEXT (t), flags);
pp_cxx_colon_colon (cxx_pp); pp_cxx_colon_colon (cxx_pp);
} }
else if (DECL_CONTEXT (t)) else if (!DECL_FILE_SCOPE_P (t))
{ {
dump_decl (DECL_CONTEXT (t), flags); dump_decl (DECL_CONTEXT (t), flags);
pp_cxx_colon_colon (cxx_pp); pp_cxx_colon_colon (cxx_pp);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment