aboutsummaryrefslogtreecommitdiff
path: root/gcc/cp/decl.c
diff options
context:
space:
mode:
authorGabriel Dos Reis <gdr@integrable-solutions.net>2003-09-07 18:52:53 +0000
committerGabriel Dos Reis <gdr@gcc.gnu.org>2003-09-07 18:52:53 +0000
commita2a9e21c333495766fc733fedbf1821b9b333840 (patch)
treea053051804681d6afd59965f85bf34dfc364a70f /gcc/cp/decl.c
parent1ab237dfa3b2afa84b952ac457eb01df96638757 (diff)
downloadgcc-a2a9e21c333495766fc733fedbf1821b9b333840.zip
gcc-a2a9e21c333495766fc733fedbf1821b9b333840.tar.gz
gcc-a2a9e21c333495766fc733fedbf1821b9b333840.tar.bz2
re PR c++/11762 (namespace aliasing ICE in warn_extern_redeclared_static)
* c-pretty-print.h (pp_c_left_brace): Declare. (pp_c_right_brace): Likewise. * c-pretty-print.c (pp_c_left_brace): Now a function (pp_c_right_brace): Likewise. cp/ PR c++/11762 * error.c (dump_decl): Handle namespace-alias-definition. * decl.c (warn_extern_redeclared_static): There is no point in checking changes in storage class specifier for a namespace declaration. (duplicate_decls): Tidy diagnostic message. * cxx-pretty-print.c (pp_cxx_left_brace): New macro. (pp_cxx_right_brace): Likewise. (pp_cxx_original_namespace_definition): New function. (pp_cxx_namespace_alias_definition): Likewise. (pp_cxx_declaration): Use them. Handle NAMESPACE_DECLs. From-SVN: r71175
Diffstat (limited to 'gcc/cp/decl.c')
-rw-r--r--gcc/cp/decl.c9
1 files changed, 6 insertions, 3 deletions
diff --git a/gcc/cp/decl.c b/gcc/cp/decl.c
index 7e87cac..ca13790 100644
--- a/gcc/cp/decl.c
+++ b/gcc/cp/decl.c
@@ -2736,7 +2736,8 @@ warn_extern_redeclared_static (tree newdecl, tree olddecl)
if (TREE_CODE (newdecl) == TYPE_DECL
|| TREE_CODE (newdecl) == TEMPLATE_DECL
- || TREE_CODE (newdecl) == CONST_DECL)
+ || TREE_CODE (newdecl) == CONST_DECL
+ || TREE_CODE (newdecl) == NAMESPACE_DECL)
return;
/* Don't get confused by static member functions; that's a different
@@ -3004,8 +3005,10 @@ duplicate_decls (tree newdecl, tree olddecl)
else if (current_class_type == NULL_TREE
|| IDENTIFIER_ERROR_LOCUS (DECL_ASSEMBLER_NAME (newdecl)) != current_class_type)
{
- error ("conflicting types for `%#D'", newdecl);
- cp_error_at ("previous declaration as `%#D'", olddecl);
+ error ("conflicting declaration '%#D'", newdecl);
+ cp_error_at ("'%D' has a previous declaration as `%#D'",
+ olddecl, olddecl);
+ return false;
}
}
else if (TREE_CODE (newdecl) == FUNCTION_DECL