]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
cp-tree.h (anonymous_namespace_name): Declare.
authorMark Mitchell <mark@markmitchell.com>
Tue, 8 Sep 1998 11:37:48 +0000 (11:37 +0000)
committerMark Mitchell <mmitchel@gcc.gnu.org>
Tue, 8 Sep 1998 11:37:48 +0000 (11:37 +0000)
* 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

gcc/cp/ChangeLog
gcc/cp/cp-tree.h
gcc/cp/decl.c
gcc/cp/error.c

index 27c37260cb923e50793d75c4cc72ac62747c193b..c1ab0e4080aa048aa7cb6b2df7873e728ac1f0b4 100644 (file)
@@ -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.
 
index 3c3a8588139a35f60b8931bb6288f566e5d6bf83..2939275d859b17afeb8b91c2ff508869a761c23c 100644 (file)
@@ -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
index bbe7b9d7e3471d8d1e842bad94f6b1b59d29b880..488cd0bc6b49138b75dc8c13233b86af69e912d4 100644 (file)
@@ -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;
+
 \f
 /* 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.  */
index dd3f952356230ab6a8b43d01a766b04311d040c1..3a505c4f0ebe5e9e37053fc02191b134ebb8405f 100644 (file)
@@ -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: