* 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
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.
extern tree null_node;
+extern tree anonymous_namespace_name;
+
/* in pt.c */
/* These values are used for the `STRICT' parameter to type_unfication and
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. */
{
/* 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. */
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: