diff options
Diffstat (limited to 'gcc/cp/parser.c')
-rw-r--r-- | gcc/cp/parser.c | 22 |
1 files changed, 10 insertions, 12 deletions
diff --git a/gcc/cp/parser.c b/gcc/cp/parser.c index ccbecd760c1..357d1cba626 100644 --- a/gcc/cp/parser.c +++ b/gcc/cp/parser.c @@ -2162,9 +2162,8 @@ cp_parser_check_decl_spec (cp_decl_specifier_seq *decl_specs, error ("%H%<long long long%> is too long for GCC", &location); else if (pedantic && !in_system_header && warn_long_long && cxx_dialect == cxx98) - pedwarn (OPT_Wlong_long, - "%HISO C++ 1998 does not support %<long long%>", - &location); + pedwarn (location, OPT_Wlong_long, + "ISO C++ 1998 does not support %<long long%>"); } else if (count > 1) { @@ -3217,9 +3216,8 @@ cp_parser_primary_expression (cp_parser *parser, && cp_lexer_next_token_is (parser->lexer, CPP_OPEN_BRACE)) { /* Statement-expressions are not allowed by the standard. */ - pedwarn (OPT_pedantic, - "%HISO C++ forbids braced-groups within expressions", - &token->location); + pedwarn (token->location, OPT_pedantic, + "ISO C++ forbids braced-groups within expressions"); /* And they're not allowed outside of a function-body; you cannot, for example, write: @@ -4548,7 +4546,7 @@ cp_parser_postfix_expression (cp_parser *parser, bool address_p, bool cast_p, { /* Warn the user that a compound literal is not allowed in standard C++. */ - pedwarn (OPT_pedantic, "ISO C++ forbids compound-literals"); + pedwarn (input_location, OPT_pedantic, "ISO C++ forbids compound-literals"); /* For simplicity, we disallow compound literals in constant-expressions. We could allow compound literals of integer type, whose @@ -7612,7 +7610,7 @@ cp_parser_jump_statement (cp_parser* parser) if (cp_lexer_next_token_is (parser->lexer, CPP_MULT)) { /* Issue a warning about this use of a GNU extension. */ - pedwarn (OPT_pedantic, "%HISO C++ forbids computed gotos", &token->location); + pedwarn (token->location, OPT_pedantic, "ISO C++ forbids computed gotos"); /* Consume the '*' token. */ cp_lexer_consume_token (parser->lexer); /* Parse the dependent expression. */ @@ -7752,7 +7750,7 @@ cp_parser_declaration_seq_opt (cp_parser* parser) invalid. Allow it unless we're being pedantic. */ cp_lexer_consume_token (parser->lexer); if (!in_system_header) - pedwarn (OPT_pedantic, "extra %<;%>"); + pedwarn (input_location, OPT_pedantic, "extra %<;%>"); continue; } @@ -11740,7 +11738,7 @@ cp_parser_enumerator_list (cp_parser* parser, tree type) if (cp_lexer_next_token_is (parser->lexer, CPP_CLOSE_BRACE)) { if (!in_system_header) - pedwarn (OPT_pedantic, "comma at end of enumerator list"); + pedwarn (input_location, OPT_pedantic, "comma at end of enumerator list"); break; } } @@ -14384,7 +14382,7 @@ cp_parser_initializer_list (cp_parser* parser, bool* non_constant_p) && cp_lexer_peek_nth_token (parser->lexer, 2)->type == CPP_COLON) { /* Warn the user that they are using an extension. */ - pedwarn (OPT_pedantic, + pedwarn (input_location, OPT_pedantic, "ISO C++ does not allow designated initializers"); /* Consume the identifier. */ identifier = cp_lexer_consume_token (parser->lexer)->u.value; @@ -15408,7 +15406,7 @@ cp_parser_member_declaration (cp_parser* parser) { cp_token *token = cp_lexer_peek_token (parser->lexer); if (!in_system_header_at (token->location)) - pedwarn (OPT_pedantic, "%Hextra %<;%>", &token->location); + pedwarn (token->location, OPT_pedantic, "extra %<;%>"); } else { |