* class.c (alter_access): Use %E format specifier to print an
authorgdr <gdr@138bc75d-0d04-0410-961f-82ee72b054a4>
Sun, 23 May 2004 10:51:45 +0000 (10:51 +0000)
committergdr <gdr@138bc75d-0d04-0410-961f-82ee72b054a4>
Sun, 23 May 2004 10:51:45 +0000 (10:51 +0000)
identifier node.  Avoid looking at the IDENTIFIER_POINTER.
(push_lang_context): Likewise.
* decl.c (lookup_label): Likewise.
(grokdeclarator): Likewise.
* parser.c (cp_parser_check_for_invalid_template_id):Likewise.
* pt.c (do_type_instantiation): Likewise.
* tree.c (handle_java_interface_attribute): Likewise.
(handle_com_interface_attribute): Likewise.
(handle_init_priority_attribute): Likewise.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@82161 138bc75d-0d04-0410-961f-82ee72b054a4

gcc/cp/ChangeLog
gcc/cp/class.c
gcc/cp/decl.c
gcc/cp/parser.c
gcc/cp/pt.c
gcc/cp/tree.c

index 9af31d5..3878c7e 100644 (file)
@@ -1,3 +1,16 @@
+2004-05-23  Gabriel Dos Reis  <gdr@integrable-solutions.net>
+
+       * class.c (alter_access): Use %E format specifier to print an
+       identifier node.  Avoid looking at the IDENTIFIER_POINTER.
+       (push_lang_context): Likewise.
+       * decl.c (lookup_label): Likewise.
+       (grokdeclarator): Likewise.
+       * parser.c (cp_parser_check_for_invalid_template_id): Likewise.
+       * pt.c (do_type_instantiation): Likewise.
+       * tree.c (handle_java_interface_attribute): Likewise.
+       (handle_com_interface_attribute): Likewise.
+       (handle_init_priority_attribute): Likewise.
+
 2004-05-22  Mark Mitchell  <mark@codesourcery.com>
 
        PR c++/15285
index 73828a8..47c60e7 100644 (file)
@@ -1055,8 +1055,8 @@ alter_access (tree t, tree fdecl, tree access)
          if (TREE_CODE (TREE_TYPE (fdecl)) == FUNCTION_DECL)
            cp_error_at ("conflicting access specifications for method `%D', ignored", TREE_TYPE (fdecl));
          else
-           error ("conflicting access specifications for field `%s', ignored",
-                  IDENTIFIER_POINTER (DECL_NAME (fdecl)));
+           error ("conflicting access specifications for field `%E', ignored",
+                  DECL_NAME (fdecl));
        }
       else
        {
@@ -5706,7 +5706,7 @@ push_lang_context (tree name)
       current_lang_name = name;
     }
   else
-    error ("language string `\"%s\"' not recognized", IDENTIFIER_POINTER (name));
+    error ("language string `\"%E\"' not recognized", name);
 }
   
 /* Get out of the current language scope.  */
index fe04827..65e8800 100644 (file)
@@ -2066,8 +2066,7 @@ lookup_label (tree id)
   /* You can't use labels at global scope.  */
   if (current_function_decl == NULL_TREE)
     {
-      error ("label `%s' referenced outside of any function",
-            IDENTIFIER_POINTER (id));
+      error ("label `%E' referenced outside of any function", id);
       POP_TIMEVAR_AND_RETURN (TV_NAME_LOOKUP, NULL_TREE);
     }
 
@@ -6746,7 +6745,7 @@ grokdeclarator (tree declarator,
                        longlong = 1;
                    }
                  else if (RIDBIT_SETP (i, specbits))
-                   pedwarn ("duplicate `%s'", IDENTIFIER_POINTER (id));
+                   pedwarn ("duplicate `%E'", id);
 
                  /* Diagnose "__thread extern" or "__thread static".  */
                  if (RIDBIT_SETP (RID_THREAD, specbits))
@@ -6786,8 +6785,7 @@ grokdeclarator (tree declarator,
        {
          tree t = lookup_name (id, 1);
          if (!t || TREE_CODE (t) != TYPE_DECL)
-           error ("`%s' fails to be a typedef or built in type",
-                  IDENTIFIER_POINTER (id));
+           error ("`%E' fails to be a typedef or built in type", id);
          else
            {
              type = TREE_TYPE (t);
@@ -7343,8 +7341,8 @@ grokdeclarator (tree declarator,
                      error ("destructor cannot be static member function");
                    if (quals)
                      {
-                       error ("destructors may not be `%s'",
-                                 IDENTIFIER_POINTER (TREE_VALUE (quals)));
+                       error ("destructors may not be `%E'",
+                                 TREE_VALUE (quals));
                        quals = NULL_TREE;
                      }
                    if (decl_context == FIELD)
@@ -7372,8 +7370,8 @@ grokdeclarator (tree declarator,
                      }
                    if (quals)
                      {
-                       error ("constructors may not be `%s'",
-                                 IDENTIFIER_POINTER (TREE_VALUE (quals)));
+                       error ("constructors may not be `%E'",
+                               TREE_VALUE (quals));
                        quals = NULL_TREE;
                      }
                    {
@@ -8179,8 +8177,8 @@ grokdeclarator (tree declarator,
          {
            if (friendp)
              {
-               error ("`%s' is neither function nor member function; cannot be declared friend",
-                      IDENTIFIER_POINTER (declarator));
+               error ("`%E' is neither function nor member function; "
+                       "cannot be declared friend", declarator);
                friendp = 0;
              }
            decl = NULL_TREE;
index fdc171e..d26061f 100644 (file)
@@ -1891,7 +1891,7 @@ cp_parser_check_for_invalid_template_id (cp_parser* parser,
       if (TYPE_P (type))
        error ("`%T' is not a template", type);
       else if (TREE_CODE (type) == IDENTIFIER_NODE)
-       error ("`%s' is not a template", IDENTIFIER_POINTER (type));
+       error ("`%E' is not a template", type);
       else
        error ("invalid template-id");
       /* Remember the location of the invalid "<".  */
index c506609..2b12479 100644 (file)
@@ -10698,8 +10698,8 @@ do_type_instantiation (tree t, tree storage, tsubst_flags_t complain)
   if (storage != NULL_TREE)
     {
       if (pedantic && !in_system_header)
-       pedwarn("ISO C++ forbids the use of `%s' on explicit instantiations", 
-                  IDENTIFIER_POINTER (storage));
+       pedwarn("ISO C++ forbids the use of `%E' on explicit instantiations", 
+                storage);
 
       if (storage == ridpointers[(int) RID_INLINE])
        nomem_p = 1;
index 1e470eb..e9bfdb8 100644 (file)
@@ -1811,8 +1811,8 @@ handle_java_interface_attribute (tree* node,
       || !CLASS_TYPE_P (*node)
       || !TYPE_FOR_JAVA (*node))
     {
-      error ("`%s' attribute can only be applied to Java class definitions",
-            IDENTIFIER_POINTER (name));
+      error ("`%E' attribute can only be applied to Java class definitions",
+            name);
       *no_add_attrs = true;
       return NULL_TREE;
     }
@@ -1840,14 +1840,14 @@ handle_com_interface_attribute (tree* node,
       || !CLASS_TYPE_P (*node)
       || *node != TYPE_MAIN_VARIANT (*node))
     {
-      warning ("`%s' attribute can only be applied to class definitions",
-              IDENTIFIER_POINTER (name));
+      warning ("`%E' attribute can only be applied to class definitions",
+              name);
       return NULL_TREE;
     }
 
   if (!warned++)
-    warning ("`%s' is obsolete; g++ vtables are now COM-compatible by default",
-            IDENTIFIER_POINTER (name));
+    warning ("`%E' is obsolete; g++ vtables are now COM-compatible by default",
+            name);
 
   return NULL_TREE;
 }
@@ -1891,8 +1891,8 @@ handle_init_priority_attribute (tree* node,
         init_priority value, so don't allow it.  */
       || current_function_decl) 
     {
-      error ("can only use `%s' attribute on file-scope definitions of objects of class type",
-            IDENTIFIER_POINTER (name));
+      error ("can only use `%E' attribute on file-scope definitions "
+             "of objects of class type", name);
       *no_add_attrs = true;
       return NULL_TREE;
     }
@@ -1919,8 +1919,7 @@ handle_init_priority_attribute (tree* node,
     }
   else
     {
-      error ("`%s' attribute is not supported on this platform",
-            IDENTIFIER_POINTER (name));
+      error ("`%E' attribute is not supported on this platform", name);
       *no_add_attrs = true;
       return NULL_TREE;
     }