aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--gcc/cp/ChangeLog5
-rw-r--r--gcc/cp/decl.c3
-rw-r--r--gcc/cp/error.c2
3 files changed, 7 insertions, 3 deletions
diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog
index de7160f..4b06056 100644
--- a/gcc/cp/ChangeLog
+++ b/gcc/cp/ChangeLog
@@ -1,5 +1,10 @@
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.
(readonly_error): Rename to...
(cxx_readonly_error): ...this. Change second argument to be an
diff --git a/gcc/cp/decl.c b/gcc/cp/decl.c
index b72b588..b75a13e 100644
--- a/gcc/cp/decl.c
+++ b/gcc/cp/decl.c
@@ -13098,8 +13098,7 @@ grokmethod (cp_decl_specifier_seq *declspecs,
if (DECL_IN_AGGR_P (fndecl))
{
- if (DECL_CONTEXT (fndecl)
- && TREE_CODE (DECL_CONTEXT (fndecl)) != NAMESPACE_DECL)
+ if (DECL_CLASS_SCOPE_P (fndecl))
error ("%qD is already defined in class %qT", fndecl,
DECL_CONTEXT (fndecl));
return error_mark_node;
diff --git a/gcc/cp/error.c b/gcc/cp/error.c
index 4fb47dc..e1bac24 100644
--- a/gcc/cp/error.c
+++ b/gcc/cp/error.c
@@ -1027,7 +1027,7 @@ dump_decl (tree t, int flags)
dump_type (DECL_CONTEXT (t), flags);
pp_cxx_colon_colon (cxx_pp);
}
- else if (DECL_CONTEXT (t))
+ else if (!DECL_FILE_SCOPE_P (t))
{
dump_decl (DECL_CONTEXT (t), flags);
pp_cxx_colon_colon (cxx_pp);