diff options
author | gdr <gdr@138bc75d-0d04-0410-961f-82ee72b054a4> | 2004-10-05 13:28:07 +0000 |
---|---|---|
committer | gdr <gdr@138bc75d-0d04-0410-961f-82ee72b054a4> | 2004-10-05 13:28:07 +0000 |
commit | a2c5b975ac31a8555d05a930625326488b0a5b20 (patch) | |
tree | 1d5a02a0305c6e15310c3848fd5e80ee697de971 /gcc/cp/parser.c | |
parent | 253cf5897a9f6530c6005746c281f0b81d2a55ad (diff) | |
download | gcc-a2c5b975ac31a8555d05a930625326488b0a5b20.tar.gz |
Convert diagnostics to use quoting flag q 4/n
* parser.c (cp_parser_name_lookup_error,
cp_parser_diagnose_invalid_type_name,
cp_parser_primary_expression, cp_parser_unqualified_id,
cp_parser_nested_name_specifier_opt,
cp_parser_labeled_statement,
cp_parser_jump_statement, cp_parser_simple_declaration,
cp_parser_decl_specifier_seq, cp_parser_mem_initializer_id,
cp_parser_type_parameter, cp_parser_template_id,
cp_parser_template_name, cp_parser_direct_declarator,
cp_parser_parameter_declaration_list, cp_parser_class_head,
cp_parser_base_specifier, cp_parser_lookup_name,
cp_parser_late_parsing_default_args,
cp_parser_optional_template_keyword
cp_parser_elaborated_type_specifier,
cp_parser_check_class_key,
cp_parser_check_access_in_redeclaration): Use quoting marks.
* name-lookup.c (supplement_binding, pushdecl,
check_for_out_of_scope_variable,
validate_nonmember_using_decl,
do_nonmember_using_decl, lookup_tag, set_decl_namespace,
push_namespace, do_namespace_alias, do_using_directive,
ambiguous_decl, lookup_namespace_name, add_function):
Likewise.
* method.c (use_thunk): Likewise.
* lex.c (unqualified_name_lookup_error,
unqualified_fn_lookup_error): Likewise.
testsuite/
merlin[1:17]% cd build
~
merlin[1:17]% ls
~/build
3 4 4.0.0 c++0x r tree
merlin[1:17]% cd 4.0.0
~/build
merlin[1:17]% cd gcc
~/build/4.0.0
merlin[1:17]% make check-g++
~/build/4.0.0/gcc
(rootme=`${PWDCMD-pwd}`; export rootme; \
srcdir=`cd /home/gdr/redhat/egcs/gcc; ${PWDCMD-pwd}` ; export srcdir ;
\
cd testsuite; \
EXPECT=`if [ -f ${rootme}/../expect/expect ] ; then echo
${rootme}/../expect/expect ; else echo expect ; fi` ; export EXPECT ;
\
if [ -f ${rootme}/../expect/expect ] ; then \
TCL_LIBRARY=`cd .. ; cd /home/gdr/redhat/egcs/gcc/../tcl/library ;
${PWDCMD-pwd}` ; \
export TCL_LIBRARY ; fi ; \
`if [ -f ${srcdir}/../dejagnu/runtest ] ; then echo
${srcdir}/../dejagnu/runtest ; else echo runtest; fi` --tool g++ )
Test Run By gdr on Tue Oct 5 01:18:04 2004
Native configuration is i686-pc-linux-gnu
=== g++ tests ===
Schedule of variations:
unix
Running target unix
Using /usr/share/dejagnu/baseboards/unix.exp as board description file
for target.
Using /usr/share/dejagnu/config/unix.exp as generic interface file for
target.
Using /home/gdr/redhat/egcs/gcc/testsuite/config/default.exp as
tool-and-target-specific interface file.
Running /home/gdr/redhat/egcs/gcc/testsuite/g++.dg/bprob/bprob.exp ...
Running /home/gdr/redhat/egcs/gcc/testsuite/g++.dg/charset/charset.exp
...
Running /home/gdr/redhat/egcs/gcc/testsuite/g++.dg/compat/compat.exp
...
Running /home/gdr/redhat/egcs/gcc/testsuite/g++.dg/debug/debug.exp ...
Running /home/gdr/redhat/egcs/gcc/testsuite/g++.dg/dg.exp ...
FAIL: g++.dg/other/classkey1.C (test for errors, line 9)
FAIL: g++.dg/other/classkey1.C (test for errors, line 11)
FAIL: g++.dg/other/classkey1.C (test for errors, line 14)
FAIL: g++.dg/other/classkey1.C (test for errors, line 17)
FAIL: g++.dg/other/classkey1.C (test for excess errors)
FAIL: g++.dg/parse/error15.C (test for errors, line 13)
FAIL: g++.dg/parse/error15.C (test for errors, line 14)
FAIL: g++.dg/parse/error15.C (test for errors, line 15)
FAIL: g++.dg/parse/error15.C (test for errors, line 21)
FAIL: g++.dg/parse/error15.C (test for errors, line 22)
FAIL: g++.dg/parse/error15.C (test for errors, line 23)
FAIL: g++.dg/parse/error15.C (test for errors, line 31)
FAIL: g++.dg/parse/error15.C (test for errors, line 32)
FAIL: g++.dg/parse/error15.C (test for errors, line 33)
FAIL: g++.dg/parse/error15.C (test for excess errors)
XPASS: g++.dg/rtti/tinfo1.C scan-assembler _ZTIP9CTemplateIhE:
XPASS: g++.dg/rtti/tinfo1.C scan-assembler-not .globl[
\t]+_ZTIP9CTemplateIhE
XPASS: g++.dg/rtti/tinfo1.C scan-assembler-not
.section[^\n\r]*_ZTIP9CTemplateIhE[^\n\r]*
FAIL: g++.dg/template/meminit2.C (test for errors, line 10)
FAIL: g++.dg/template/meminit2.C (test for errors, line 11)
FAIL: g++.dg/template/meminit2.C (test for excess errors)
Running /home/gdr/redhat/egcs/gcc/testsuite/g++.dg/gcov/gcov.exp ...
FAIL: 102:is -:should be 1
FAIL: g++.dg/gcov/gcov-1.C gcov: 1 failures in line counts, 0 in
branch percentamerlin[1:27]% make check-g++
~/build/4.0.0/gcc
(rootme=`${PWDCMD-pwd}`; export rootme; \
srcdir=`cd /home/gdr/redhat/egcs/gcc; ${PWDCMD-pwd}` ; export srcdir ;
\
cd testsuite; \
EXPECT=`if [ -f ${rootme}/../expect/expect ] ; then echo
${rootme}/../expect/expect ; else echo expect ; fi` ; export EXPECT ;
\
if [ -f ${rootme}/../expect/expect ] ; then \
TCL_LIBRARY=`cd .. ; cd /home/gdr/redhat/egcs/gcc/../tcl/library ;
${PWDCMD-pwd}` ; \
export TCL_LIBRARY ; fi ; \
`if [ -f ${srcdir}/../dejagnu/runtest ] ; then echo
${srcdir}/../dejagnu/runtest ; else echo runtest; fi` --tool g++ )
Test Run By gdr on Tue Oct 5 01:27:39 2004
Native configuration is i686-pc-linux-gnu
=== g++ tests ===
Schedule of variations:
unix
Running target unix
Using /usr/share/dejagnu/baseboards/unix.exp as board description file
for target.
Using /usr/share/dejagnu/config/unix.exp as generic interface file for
tar method.c
cfns.gperf cxx-pretty-print.c method.c.~1.315.~
cfns.h cxx-pretty-print.h name-lookup.c
ChangeLog decl2.c name-lookup.c.~1.85.~
ChangeLog.1 decl.c name-lookup.h
ChangeLog.~1.4404.~ decl.h NEWS
ChangeLog.2 dump.c operators.def
ChangeLog.3 error.c optimize.c
ChangeLog.egcs except.c parser.c
ChangeLog.tree-ssa expr.c parser.c.~1.258.~
class.c friend.c pt.c
config-lang.in g++spec.c ptree.c
cp-gimplify.c init.c repo.c
cp-lang.c init.c.~1.396.~ rtti.c
cp-objcp-common.c lang-specs.h search.c
cp-objcp-common.h lex.c semantics.c
cp-tree.def lex.c.~1.349.~ tree.c
cp-tree.h Make-lang.in typeck2.c
CVS mangle.c typeck.c
merlin[7:37]% cvs -z9 diff -p > ~/d-5.patch
~/redhat/egcs/gcc/cp
Enter passphrase for RSA key '/home/gdr/.ssh/identity': cvs [diff
aborted]: received interrupt signal
merlin[7:37]% cvs -z9 diff -p > ~/d-5.patch
~/redhat/egcs/gcc/cp
Warning: Remote host denied X11 forwarding.
Warning: Remote host denied authentication agent forwarding.
cvs diff: Diffing .
merlin[7:38]% l ~/d-5.patch
~/redhat/egcs/gcc/cp
merlin[7:39]% cvs -z9 diff -p > ~/d-5.patch
~/redhat/egcs/gcc/cp
Warning: Remote host denied X11 forwarding.
Warning: Remote host denied authentication agent forwarding.
cvs diff: Diffing .
merlin[7:40]% l ~/d-5.patch
~/redhat/egcs/gcc/cp
You have new mail.
merlin[8:21]% cvs -z9 commit
~/redhat/egcs/gcc/cp
merlin[8:21]% cd .
~/redhat/egcs/gcc/cp
merlin[8:21]% cvs -z9 commit cp testsuite
~/redhat/egcs/gcc/cp
cvs commit: nothing known about `cp'
cvs commit: nothing known about `testsuite'
cvs [commit aborted]: correct above errors first!
merlin[8:21]% cd ..
~/redhat/egcs/gcc/cp
merlin[8:21]% cvs -z9 commit cp testsuite
~/redhat/egcs/gcc
cvs commit: Examining cp
cvs commit: Examining testsuite
cvs commit: Examining testsuite/ada
cvs commit: Examining testsuite/ada/acats
cvs commit: Examining testsuite/ada/acats/support
cvs commit: Examining testsuite/ada/acats/tests
cvs commit: Examining testsuite/ada/acats/tests/a
cvs commit: Examining testsuite/ada/acats/tests/c2
cvs commit: Examining testsuite/ada/acats/tests/c3
cvs commit: Examining testsuite/ada/acats/tests/c4
cvs commit: Examining testsuite/ada/acats/tests/c5
cvs commit: Examining testsuite/ada/acats/tests/c6
cvs commit: Examining testsuite/ada/acats/tests/c7
cvs commit: Examining testsuite/ada/acats/tests/c8
cvs commit: Examining testsuite/ada/acats/tests/c9
cvs commit: Examining testsuite/ada/acats/tests/ca
cvs commit: Examining testsuite/ada/acats/tests/cb
cvs commit: Examining testsuite/ada/acats/tests/cc
cvs commit: Examining testsuite/ada/acats/tests/cd
cvs commit: Examining testsuite/ada/acats/tests/ce
cvs commit: Examining testsuite/ada/acats/tests/cxa
cvs commit: Examining testsuite/ada/acats/tests/cxb
cvs commit: Examining testsuite/ada/acats/tests/cxf
cvs commit: Examining testsuite/ada/acats/tests/cxg
cvs commit: Examining testsuite/ada/acats/tests/cxh
cvs commit: Examining testsuite/ada/acats/tests/cz
cvs commit: Examining testsuite/ada/acats/tests/d
cvs commit: Examining testsuite/ada/acats/tests/e
cvs commit: Examining testsuite/ada/acats/tests/gcc
cvs commit: Examining testsuite/ada/acats/tests/l
cvs commit: Examining testsuite/config
cvs commit: Examining testsuite/consistency.vlad
cvs commit: Examining testsuite/consistency.vlad/layout
cvs commit: Examining
testsuite/consistency.vlad/layout/i960-97r2-results
cvs commit: Examining testsuite/g++.dg
cvs commit: Examining testsuite/g++.dg/abi
cvs commit: Examining testsuite/g++.dg/bprob
cvs commit: Examining testsuite/g++.dg/charset
cvs commit: Examining testsuite/g++.dg/compat
cvs commit: Examining testsuite/g++.dg/compat/abi
cvs commit: Examinin
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@88552 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/cp/parser.c')
-rw-r--r-- | gcc/cp/parser.c | 113 |
1 files changed, 57 insertions, 56 deletions
diff --git a/gcc/cp/parser.c b/gcc/cp/parser.c index 192855de52a..ed65334852a 100644 --- a/gcc/cp/parser.c +++ b/gcc/cp/parser.c @@ -1872,26 +1872,26 @@ cp_parser_name_lookup_error (cp_parser* parser, if (decl == error_mark_node) { if (parser->scope && parser->scope != global_namespace) - error ("`%D::%D' has not been declared", + error ("%<%D::%D%> has not been declared", parser->scope, name); else if (parser->scope == global_namespace) - error ("`::%D' has not been declared", name); + error ("%<::%D%> has not been declared", name); else if (parser->object_scope && !CLASS_TYPE_P (parser->object_scope)) - error ("request for member `%D' in non-class type `%T'", + error ("request for member %qD in non-class type %qT", name, parser->object_scope); else if (parser->object_scope) - error ("`%T::%D' has not been declared", + error ("%<%T::%D%> has not been declared", parser->object_scope, name); else error ("`%D' has not been declared", name); } else if (parser->scope && parser->scope != global_namespace) - error ("`%D::%D' %s", parser->scope, name, desired); + error ("%<%D::%D%> %s", parser->scope, name, desired); else if (parser->scope == global_namespace) - error ("`::%D' %s", name, desired); + error ("%<::%D%> %s", name, desired); else - error ("`%D' %s", name, desired); + error ("%qD %s", name, desired); } /* If we are parsing tentatively, remember that an error has occurred @@ -1962,9 +1962,9 @@ cp_parser_check_for_invalid_template_id (cp_parser* parser, if (cp_lexer_next_token_is (parser->lexer, CPP_LESS)) { if (TYPE_P (type)) - error ("`%T' is not a template", type); + error ("%qT is not a template", type); else if (TREE_CODE (type) == IDENTIFIER_NODE) - error ("`%E' is not a template", type); + error ("%qE is not a template", type); else error ("invalid template-id"); /* Remember the location of the invalid "<". */ @@ -2031,12 +2031,12 @@ cp_parser_diagnose_invalid_type_name (cp_parser *parser, tree scope, tree id) /* If the lookup found a template-name, it means that the user forgot to specify an argument list. Emit an useful error message. */ if (TREE_CODE (decl) == TEMPLATE_DECL) - error ("invalid use of template-name `%E' without an argument list", + error ("invalid use of template-name %qE without an argument list", decl); else if (!parser->scope) { /* Issue an error message. */ - error ("`%E' does not name a type", id); + error ("%qE does not name a type", id); /* If we're in a template class, it's possible that the user was referring to a type from a base class. For example: @@ -2082,11 +2082,10 @@ cp_parser_diagnose_invalid_type_name (cp_parser *parser, tree scope, tree id) else { if (TREE_CODE (parser->scope) == NAMESPACE_DECL) - error ("`%E' in namespace `%E' does not name a type", + error ("%qE in namespace %qE does not name a type", id, parser->scope); else if (TYPE_P (parser->scope)) - error ("`%E' in class `%T' does not name a type", - id, parser->scope); + error ("q%E in class %qT does not name a type", id, parser->scope); else gcc_unreachable (); } @@ -2816,7 +2815,7 @@ cp_parser_primary_expression (cp_parser *parser, cp_lexer_consume_token (parser->lexer); if (parser->local_variables_forbidden_p) { - error ("`this' may not be used in this context"); + error ("%<this%> may not be used in this context"); return error_mark_node; } /* Pointers cannot appear in constant-expressions. */ @@ -2951,7 +2950,7 @@ cp_parser_primary_expression (cp_parser *parser, decl = check_for_out_of_scope_variable (decl); if (local_variable_p (decl)) { - error ("local variable `%D' may not appear in this context", + error ("local variable %qD may not appear in this context", decl); return error_mark_node; } @@ -3316,7 +3315,7 @@ cp_parser_unqualified_id (cp_parser* parser, if (declarator_p && !DECL_IMPLICIT_TYPEDEF_P (type_decl) && !DECL_SELF_REFERENCE_P (type_decl)) - error ("typedef-name `%D' used as destructor declarator", + error ("typedef-name %qD used as destructor declarator", type_decl); return build_nt (BIT_NOT_EXPR, TREE_TYPE (type_decl)); @@ -3522,8 +3521,7 @@ cp_parser_nested_name_specifier_opt (cp_parser *parser, decl = cp_parser_lookup_name_simple (parser, token->value); if (TREE_CODE (decl) == TEMPLATE_DECL) - error ("`%D' used without template parameters", - decl); + error ("%qD used without template parameters", decl); else cp_parser_name_lookup_error (parser, token->value, decl, @@ -5051,7 +5049,8 @@ cp_parser_direct_new_declarator (cp_parser* parser) /*complain=*/true); if (!expression) { - error ("expression in new-declarator must have integral or enumeration type"); + error ("expression in new-declarator must have integral " + "or enumeration type"); expression = error_mark_node; } } @@ -5987,7 +5986,7 @@ cp_parser_labeled_statement (cp_parser* parser, tree in_statement_expr) expr_hi = NULL_TREE; if (!parser->in_switch_statement_p) - error ("case label `%E' not within a switch statement", expr); + error ("case label %qE not within a switch statement", expr); else statement = finish_case_label (expr, expr_hi); } @@ -6493,7 +6492,7 @@ cp_parser_jump_statement (cp_parser* parser) } else statement = finish_break_stmt (); - cp_parser_require (parser, CPP_SEMICOLON, "`;'"); + cp_parser_require (parser, CPP_SEMICOLON, "%<;%>"); break; case RID_CONTINUE: @@ -6504,7 +6503,7 @@ cp_parser_jump_statement (cp_parser* parser) } else statement = finish_continue_stmt (); - cp_parser_require (parser, CPP_SEMICOLON, "`;'"); + cp_parser_require (parser, CPP_SEMICOLON, "%<;%>"); break; case RID_RETURN: @@ -6520,7 +6519,7 @@ cp_parser_jump_statement (cp_parser* parser) /* Build the return-statement. */ statement = finish_return_stmt (expr); /* Look for the final `;'. */ - cp_parser_require (parser, CPP_SEMICOLON, "`;'"); + cp_parser_require (parser, CPP_SEMICOLON, "%<;%>"); } break; @@ -6539,7 +6538,7 @@ cp_parser_jump_statement (cp_parser* parser) else finish_goto_stmt (cp_parser_identifier (parser)); /* Look for the final `;'. */ - cp_parser_require (parser, CPP_SEMICOLON, "`;'"); + cp_parser_require (parser, CPP_SEMICOLON, "%<;%>"); break; default: @@ -6997,7 +6996,7 @@ cp_parser_simple_declaration (cp_parser* parser, if (decl != error_mark_node || (cp_parser_parsing_tentatively (parser) && !cp_parser_committed_to_tentative_parse (parser))) - cp_parser_error (parser, "expected `,' or `;'"); + cp_parser_error (parser, "expected %<,%> or %<;%>"); /* Skip tokens until we reach the end of the statement. */ cp_parser_skip_to_end_of_statement (parser); /* If the next token is now a `;', consume it. */ @@ -7105,7 +7104,7 @@ cp_parser_decl_specifier_seq (cp_parser* parser, friend */ case RID_FRIEND: if (decl_specs->specs[(int) ds_friend]++) - error ("duplicate `friend'"); + error ("duplicate %<friend%>"); /* Consume the token. */ cp_lexer_consume_token (parser->lexer); break; @@ -7679,7 +7678,7 @@ cp_parser_mem_initializer_id (cp_parser* parser) /* `typename' is not allowed in this context ([temp.res]). */ if (cp_lexer_next_token_is_keyword (parser->lexer, RID_TYPENAME)) { - error ("keyword `typename' not allowed in this context (a qualified " + error ("keyword %<typename%> not allowed in this context (a qualified " "member initializer is implicitly a type)"); cp_lexer_consume_token (parser->lexer); } @@ -8041,7 +8040,7 @@ cp_parser_template_declaration (cp_parser* parser, bool member_p) /* Consume the `export' token. */ cp_lexer_consume_token (parser->lexer); /* Warn that we do not support `export'. */ - warning ("keyword `export' not implemented, and will be ignored"); + warning ("keyword %<export%> not implemented, and will be ignored"); } cp_parser_template_declaration_after_export (parser, member_p); @@ -8294,7 +8293,7 @@ cp_parser_type_parameter (cp_parser* parser) default: /* Anything else is an error. */ cp_parser_error (parser, - "expected `class', `typename', or `template'"); + "expected %<class%>, %<typename%>, or %<template%>"); parameter = error_mark_node; } @@ -8408,21 +8407,21 @@ cp_parser_template_id (cp_parser *parser, and return simply an error. Maybe this is not a template-id after all. */ next_token_2->type = CPP_COLON; - cp_parser_error (parser, "expected `<'"); + cp_parser_error (parser, "expected %<<%>"); pop_deferring_access_checks (); return error_mark_node; } /* Otherwise, emit an error about the invalid digraph, but continue parsing because we got our argument list. */ - pedwarn ("`<::' cannot begin a template-argument list"); - inform ("`<:' is an alternate spelling for `['. Insert whitespace " - "between `<' and `::'"); + pedwarn ("%<<::%> cannot begin a template-argument list"); + inform ("%<<:%> is an alternate spelling for %<[%>. Insert whitespace " + "between %<<%> and %<::%>"); if (!flag_permissive) { static bool hint; if (!hint) { - inform ("(if you use `-fpermissive' G++ will accept your code)"); + inform ("(if you use -fpermissive G++ will accept your code)"); hint = true; } } @@ -8597,8 +8596,8 @@ cp_parser_template_name (cp_parser* parser, ptrdiff_t start; cp_token* token; /* Explain what went wrong. */ - error ("non-template `%D' used as template", identifier); - inform ("use `%T::template %D' to indicate that it is a template", + error ("non-template %qD used as template", identifier); + inform ("use %<%T::template %D%> to indicate that it is a template", parser->scope, identifier); /* If parsing tentatively, find the location of the "<" token. */ @@ -9625,7 +9624,7 @@ cp_parser_elaborated_type_specifier (cp_parser* parser, tag_type = typename_type; /* The `typename' keyword is only allowed in templates. */ if (!processing_template_decl) - pedwarn ("using `typename' outside of template"); + pedwarn ("using %<typename%> outside of template"); } /* Otherwise it must be a class-key. */ else @@ -11068,7 +11067,7 @@ cp_parser_direct_declarator (cp_parser* parser, /*only_current_p=*/false); /* If that failed, the declarator is invalid. */ if (type == error_mark_node) - error ("`%T::%D' is not a type", + error ("%<%T::%D%> is not a type", TYPE_CONTEXT (scope), TYPE_IDENTIFIER (scope)); /* Build a new DECLARATOR. */ @@ -11114,8 +11113,9 @@ cp_parser_direct_declarator (cp_parser* parser, && CLASSTYPE_USE_TEMPLATE (TREE_TYPE (unqualified_name))) { error ("invalid use of constructor as a template"); - inform ("use `%T::%D' instead of `%T::%T' to name the " - "constructor in a qualified name", class_type, + inform ("use %<%T::%D%> instead of %<%T::%T%> to name " + "the constructor in a qualified name", + class_type, DECL_NAME (TYPE_TI_TEMPLATE (class_type)), class_type, class_type); } @@ -11626,7 +11626,7 @@ cp_parser_parameter_declaration_list (cp_parser* parser, bool *is_error) } else { - cp_parser_error (parser, "expected `,' or `...'"); + cp_parser_error (parser, "expected %<,%> or %<...%>"); if (!cp_parser_parsing_tentatively (parser) || cp_parser_committed_to_tentative_parse (parser)) cp_parser_skip_to_closing_parenthesis (parser, @@ -12595,7 +12595,7 @@ cp_parser_class_head (cp_parser* parser, xref_tag, since that has irreversible side-effects. */ if (!cp_parser_next_token_starts_class_definition_p (parser)) { - cp_parser_error (parser, "expected `{' or `:'"); + cp_parser_error (parser, "expected %<{%> or %<:%>"); return error_mark_node; } @@ -12620,8 +12620,8 @@ cp_parser_class_head (cp_parser* parser, class was originally declared, the program is invalid. */ if (scope && !is_ancestor (scope, nested_name_specifier)) { - error ("declaration of `%D' in `%D' which does not " - "enclose `%D'", type, scope, nested_name_specifier); + error ("declaration of %qD in %qD which does not enclose %qD", + type, scope, nested_name_specifier); type = NULL_TREE; goto done; } @@ -12644,7 +12644,7 @@ cp_parser_class_head (cp_parser* parser, && parser->num_template_parameter_lists == 0 && template_id_p) { - error ("an explicit specialization must be preceded by 'template <>'"); + error ("an explicit specialization must be preceded by %<template <>%>"); invalid_explicit_specialization_p = true; /* Take the same action that would have been taken by cp_parser_explicit_specialization. */ @@ -13179,7 +13179,7 @@ cp_parser_member_declaration (cp_parser* parser) else if (cp_lexer_next_token_is_not (parser->lexer, CPP_SEMICOLON)) { - cp_parser_error (parser, "expected `;'"); + cp_parser_error (parser, "expected %<;%>"); /* Skip tokens until we find a `;'. */ cp_parser_skip_to_end_of_statement (parser); @@ -13364,7 +13364,7 @@ cp_parser_base_specifier (cp_parser* parser) if (virtual_p && !duplicate_virtual_error_issued_p) { cp_parser_error (parser, - "`virtual' specified more than once in base-specified"); + "%<virtual%> specified more than once in base-specified"); duplicate_virtual_error_issued_p = true; } @@ -13406,9 +13406,9 @@ cp_parser_base_specifier (cp_parser* parser) if (cp_lexer_next_token_is_keyword (parser->lexer, RID_TYPENAME)) { if (!processing_template_decl) - error ("keyword `typename' not allowed outside of templates"); + error ("keyword %<typename%> not allowed outside of templates"); else - error ("keyword `typename' not allowed in this context " + error ("keyword %<typename%> not allowed in this context " "(the base class is implicitly a type)"); cp_lexer_consume_token (parser->lexer); } @@ -14243,7 +14243,7 @@ cp_parser_lookup_name (cp_parser *parser, tree name, cp_parser_error, so we incorporate its actions directly. */ if (!cp_parser_simulate_error (parser)) { - error ("reference to `%D' is ambiguous", name); + error ("reference to %qD is ambiguous", name); print_candidates (decl); } return error_mark_node; @@ -15203,7 +15203,7 @@ cp_parser_late_parsing_default_args (cp_parser *parser, tree fn) there was extra junk after the end of the default argument. */ if (!cp_lexer_next_token_is (parser->lexer, CPP_EOF)) - cp_parser_error (parser, "expected `,'"); + cp_parser_error (parser, "expected %<,%>"); /* Revert to the main lexer. */ cp_parser_pop_lexer (parser); @@ -15572,7 +15572,7 @@ static void cp_parser_check_class_key (enum tag_types class_key, tree type) { if ((TREE_CODE (type) == UNION_TYPE) != (class_key == union_type)) - pedwarn ("`%s' tag used in naming `%#T'", + pedwarn ("%qs tag used in naming %q#T", class_key == union_type ? "union" : class_key == record_type ? "struct" : "class", type); @@ -15583,7 +15583,8 @@ cp_parser_check_class_key (enum tag_types class_key, tree type) This applies to nested classes and nested class templates. [class.mem/1]. */ -static void cp_parser_check_access_in_redeclaration (tree decl) +static void +cp_parser_check_access_in_redeclaration (tree decl) { if (!CLASS_TYPE_P (TREE_TYPE (decl))) return; @@ -15592,7 +15593,7 @@ static void cp_parser_check_access_in_redeclaration (tree decl) != (current_access_specifier == access_private_node)) || (TREE_PROTECTED (decl) != (current_access_specifier == access_protected_node))) - error ("%D redeclared with different access", decl); + error ("%qD redeclared with different access", decl); } /* Look for the `template' keyword, as a syntactic disambiguator. @@ -15609,7 +15610,7 @@ cp_parser_optional_template_keyword (cp_parser *parser) template and what is not. */ if (!processing_template_decl) { - error ("`template' (as a disambiguator) is only allowed " + error ("%<template%> (as a disambiguator) is only allowed " "within templates"); /* If this part of the token stream is rescanned, the same error message would be generated. So, we purge the token |