+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
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
{
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. */
/* 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);
}
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))
{
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);
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)
}
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;
}
{
{
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;
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 "<". */
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;
|| !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;
}
|| !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;
}
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;
}
}
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;
}