class.c (alter_access): Use %E format specifier to print an identifier node.

* 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.

From-SVN: r82161
This commit is contained in:
Gabriel Dos Reis 2004-05-23 10:51:45 +00:00 committed by Gabriel Dos Reis
parent 5763419e53
commit 4460cef225
6 changed files with 37 additions and 27 deletions

View 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

View 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. */

View 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;

View 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 "<". */

View 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;

View 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;
}