From 761ad35c86ae6eb2101259feacc54ce409ca2ff5 Mon Sep 17 00:00:00 2001 From: Volker Reichelt Date: Mon, 24 Apr 2017 20:30:29 +0000 Subject: [PATCH] decl.c (grokdeclarator): Use %qT instead of %<%T%> in * decl.c (grokdeclarator): Use %qT instead of %<%T%> in * diagnostics. (start_enum): Likewise. (build_enumerator): Likewise. Use %qE instead of plain %E. * parser.c (cp_parser_mem_initializer_list): Use %qD instead of %<%D%> in diagnostics. (cp_parser_elaborated_type_specifier): Likewise. * pt.c (make_pack_expansion): Use %qT and %qE instead of %<%T%> and %<%E%> in diagnostics. (tsubst_pack_expansion): Likewise. From-SVN: r247110 --- gcc/cp/ChangeLog | 12 ++++++++++++ gcc/cp/decl.c | 10 +++++----- gcc/cp/parser.c | 4 ++-- gcc/cp/pt.c | 12 +++++------- 4 files changed, 24 insertions(+), 14 deletions(-) diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog index 97bf27ffc8f..ecdf61630b5 100644 --- a/gcc/cp/ChangeLog +++ b/gcc/cp/ChangeLog @@ -1,3 +1,15 @@ +2017-04-24 Volker Reichelt + + * decl.c (grokdeclarator): Use %qT instead of %<%T%> in diagnostics. + (start_enum): Likewise. + (build_enumerator): Likewise. Use %qE instead of plain %E. + * parser.c (cp_parser_mem_initializer_list): Use %qD instead of + %<%D%> in diagnostics. + (cp_parser_elaborated_type_specifier): Likewise. + * pt.c (make_pack_expansion): Use %qT and %qE instead of + %<%T%> and %<%E%> in diagnostics. + (tsubst_pack_expansion): Likewise. + 2017-04-24 David Malcolm PR c++/80016 diff --git a/gcc/cp/decl.c b/gcc/cp/decl.c index 8e9a466afa0..8c8cf84a1da 100644 --- a/gcc/cp/decl.c +++ b/gcc/cp/decl.c @@ -11433,9 +11433,9 @@ grokdeclarator (const cp_declarator *declarator, { error (funcdef_flag || initialized ? G_("cannot define member function %<%T::%s%> " - "within %<%T%>") + "within %qT") : G_("cannot declare member function %<%T::%s%> " - "within %<%T%>"), + "within %qT"), ctype, name, current_class_type); return error_mark_node; } @@ -14150,7 +14150,7 @@ start_enum (tree name, tree enumtype, tree underlying_type, else if (dependent_type_p (underlying_type)) ENUM_UNDERLYING_TYPE (enumtype) = underlying_type; else - error ("underlying type %<%T%> of %<%T%> must be an integral type", + error ("underlying type %qT of %qT must be an integral type", underlying_type, enumtype); } @@ -14560,8 +14560,8 @@ incremented enumerator value is too large for %")); && TREE_CODE (value) == INTEGER_CST) { if (!int_fits_type_p (value, ENUM_UNDERLYING_TYPE (enumtype))) - error ("enumerator value %E is outside the range of underlying " - "type %<%T%>", value, ENUM_UNDERLYING_TYPE (enumtype)); + error ("enumerator value %qE is outside the range of underlying " + "type %qT", value, ENUM_UNDERLYING_TYPE (enumtype)); /* Convert the value to the appropriate type. */ value = fold_convert (ENUM_UNDERLYING_TYPE (enumtype), value); diff --git a/gcc/cp/parser.c b/gcc/cp/parser.c index 3a0e0cb050f..31eb3d2e155 100644 --- a/gcc/cp/parser.c +++ b/gcc/cp/parser.c @@ -14084,7 +14084,7 @@ cp_parser_mem_initializer_list (cp_parser* parser) && !TYPE_P (TREE_PURPOSE (mem_initializer))) { error_at (token->location, - "cannot expand initializer for member %<%D%>", + "cannot expand initializer for member %qD", TREE_PURPOSE (mem_initializer)); mem_initializer = error_mark_node; } @@ -17274,7 +17274,7 @@ cp_parser_elaborated_type_specifier (cp_parser* parser, || cp_lexer_next_token_is_keyword (parser->lexer, RID_STRUCT)) { pedwarn (input_location, 0, "elaborated-type-specifier " - "for a scoped enum must not use the %<%D%> keyword", + "for a scoped enum must not use the %qD keyword", cp_lexer_peek_token (parser->lexer)->u.value); /* Consume the `struct' or `class' and parse it anyway. */ cp_lexer_consume_token (parser->lexer); diff --git a/gcc/cp/pt.c b/gcc/cp/pt.c index f8436b30b37..cf6ba6dc9e6 100644 --- a/gcc/cp/pt.c +++ b/gcc/cp/pt.c @@ -3701,7 +3701,7 @@ make_pack_expansion (tree arg) if (parameter_packs == NULL_TREE) { - error ("base initializer expansion %<%T%> contains no parameter packs", arg); + error ("base initializer expansion %qT contains no parameter packs", arg); delete ppd.visited; return error_mark_node; } @@ -3765,9 +3765,9 @@ make_pack_expansion (tree arg) if (parameter_packs == NULL_TREE) { if (TYPE_P (arg)) - error ("expansion pattern %<%T%> contains no argument packs", arg); + error ("expansion pattern %qT contains no argument packs", arg); else - error ("expansion pattern %<%E%> contains no argument packs", arg); + error ("expansion pattern %qE contains no argument packs", arg); return error_mark_node; } PACK_EXPANSION_PARAMETER_PACKS (result) = parameter_packs; @@ -11409,12 +11409,10 @@ tsubst_pack_expansion (tree t, tree args, tsubst_flags_t complain, if (!(complain & tf_error)) /* Fail quietly. */; else if (TREE_CODE (t) == TYPE_PACK_EXPANSION) - error ("mismatched argument pack lengths while expanding " - "%<%T%>", + error ("mismatched argument pack lengths while expanding %qT", pattern); else - error ("mismatched argument pack lengths while expanding " - "%<%E%>", + error ("mismatched argument pack lengths while expanding %qE", pattern); return error_mark_node; } -- 2.30.2