diff options
author | Mark Mitchell <mark@markmitchell.com> | 1998-09-08 11:37:48 +0000 |
---|---|---|
committer | Mark Mitchell <mmitchel@gcc.gnu.org> | 1998-09-08 11:37:48 +0000 |
commit | 0c8feefe300038d33498ad1d956981310b3d1823 (patch) | |
tree | 8ba45d756b13acf8138233ef329e90204ef257fc /gcc | |
parent | 57af83585d7a0f82770b2777ef07a86635d436f6 (diff) | |
download | gcc-0c8feefe300038d33498ad1d956981310b3d1823.zip gcc-0c8feefe300038d33498ad1d956981310b3d1823.tar.gz gcc-0c8feefe300038d33498ad1d956981310b3d1823.tar.bz2 |
cp-tree.h (anonymous_namespace_name): Declare.
* cp-tree.h (anonymous_namespace_name): Declare.
* decl.c: Define it.
(push_namespace): Use anonymous_namespace_name, rather than local
static anon_name.
* error.c (dump_decl): If a namespace is named
anonymous_namespace_name, call it {anonymous}.
From-SVN: r22329
Diffstat (limited to 'gcc')
-rw-r--r-- | gcc/cp/ChangeLog | 7 | ||||
-rw-r--r-- | gcc/cp/cp-tree.h | 2 | ||||
-rw-r--r-- | gcc/cp/decl.c | 11 | ||||
-rw-r--r-- | gcc/cp/error.c | 5 |
4 files changed, 20 insertions, 5 deletions
diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog index 27c3726..c1ab0e4 100644 --- a/gcc/cp/ChangeLog +++ b/gcc/cp/ChangeLog @@ -1,5 +1,12 @@ 1998-09-08 Mark Mitchell <mark@markmitchell.com> + * cp-tree.h (anonymous_namespace_name): Declare. + * decl.c: Define it. + (push_namespace): Use anonymous_namespace_name, rather than local + static anon_name. + * error.c (dump_decl): If a namespace is named + anonymous_namespace_name, call it {anonymous}. + * decl.c (grokparms): Distinguish between references and pointers in error message. diff --git a/gcc/cp/cp-tree.h b/gcc/cp/cp-tree.h index 3c3a858..2939275 100644 --- a/gcc/cp/cp-tree.h +++ b/gcc/cp/cp-tree.h @@ -1924,6 +1924,8 @@ extern tree boolean_type_node, boolean_true_node, boolean_false_node; extern tree null_node; +extern tree anonymous_namespace_name; + /* in pt.c */ /* These values are used for the `STRICT' parameter to type_unfication and diff --git a/gcc/cp/decl.c b/gcc/cp/decl.c index bbe7b9d..488cd0b 100644 --- a/gcc/cp/decl.c +++ b/gcc/cp/decl.c @@ -559,6 +559,10 @@ extern tree previous_class_values; node, but signed. */ tree signed_size_zero_node; +/* The name of the anonymous namespace, throughout this translation + unit. */ +tree anonymous_namespace_name; + /* Allocate a level of searching. */ @@ -1783,10 +1787,9 @@ push_namespace (name) { /* The name of anonymous namespace is unique for the translation unit. */ - static tree anon_name = NULL_TREE; - if (!anon_name) - anon_name = get_file_function_name ('N'); - name = anon_name; + if (!anonymous_namespace_name) + anonymous_namespace_name = get_file_function_name ('N'); + name = anonymous_namespace_name; d = IDENTIFIER_NAMESPACE_VALUE (name); if (d) /* Reopening anonymous namespace. */ diff --git a/gcc/cp/error.c b/gcc/cp/error.c index dd3f952..3a505c4 100644 --- a/gcc/cp/error.c +++ b/gcc/cp/error.c @@ -733,7 +733,10 @@ dump_decl (t, v) dump_decl (DECL_CONTEXT (t), v); OB_PUTC2 (':',':'); } - OB_PUTID (DECL_NAME (t)); + if (DECL_NAME (t) == anonymous_namespace_name) + OB_PUTS ("{anonymous}"); + else + OB_PUTID (DECL_NAME (t)); break; case SCOPE_REF: |