diff options
author | Manuel López-Ibáñez <manu@gcc.gnu.org> | 2012-04-22 19:17:47 +0000 |
---|---|---|
committer | Manuel López-Ibáñez <manu@gcc.gnu.org> | 2012-04-22 19:17:47 +0000 |
commit | c1771a200ab9fd1e9afc921684daab9a8649d897 (patch) | |
tree | 25f6840e8f549e45366fc499af6bd5be146d1839 /gcc/cp/parser.c | |
parent | f12e8bd5c3e7063f4e616bda3cab540ea73ac446 (diff) | |
download | gcc-c1771a200ab9fd1e9afc921684daab9a8649d897.zip gcc-c1771a200ab9fd1e9afc921684daab9a8649d897.tar.gz gcc-c1771a200ab9fd1e9afc921684daab9a8649d897.tar.bz2 |
re PR c/44774 (-Werror=edantic)
2012-04-22 Manuel López-Ibáñez <manu@gcc.gnu.org>
PR c/44774
gcc/
* doc/invoke.texi (pedantic): Rename to Wpedantic.
* common.opt (Wpedantic): New.
(pedantic): Alias Wpedantic.
* diagnostic.c (warning_at): Likewise.
* c-decl.c (diagnose_mismatched_decls): Likewise.
(build_array_declarator): Likewise.
(mark_forward_parm_decls):
(check_bitfield_type_and_width): Likewise.
(grokdeclarator): Likewise.
(grokfield): Likewise.
(finish_struct): Likewise.
(build_enumerator): Likewise.
(store_parm_decls_oldstyle): Likewise.
(declspecs_add_qual): Likewise.
(declspecs_add_type): Likewise.
(finish_declspecs): Likewise.
* c-typeck.c (composite_type): Likewise.
(comp_target_types): Likewise.
(build_array_ref): Likewise.
(pointer_diff): Likewise.
(build_unary_op): Likewise.
(build_conditional_expr): Likewise.
(build_c_cast): Likewise.
(convert_for_assignment): Likewise.
(maybe_warn_string_init): Likewise.
(digest_init): Likewise.
(pop_init_level): Likewise.
(set_init_index): Likewise.
(c_finish_goto_label): Likewise.
(c_finish_return): Likewise.
(do_case): Likewise.
(build_binary_op): Likewise.
* c-parser.c (static): Likewise.
(c_parser_external_declaration): Likewise.
(c_parser_declaration_or_fndef): Likewise.
(c_parser_static_assert_declaration_no_se): Likewise.
(c_parser_enum_specifier): Likewise.
(c_parser_struct_or_union_specifier): Likewise.
(c_parser_struct_declaration): Likewise.
(c_parser_alignas_specifier): Likewise.
(c_parser_braced_init): Likewise.
(c_parser_initelt): Likewise.
(c_parser_compound_statement_nostart): Likewise.
(c_parser_conditional_expression): Likewise.
(c_parser_alignof_expression): Likewise.
(c_parser_postfix_expression): Likewise.
(c_parser_postfix_expression_after_paren_): Likewise.
(c_parser_objc_class_instance_variables): Likewise.
(c_parser_objc_method_definition): Likewise.
(c_parser_objc_methodprotolist): Likewise.
c-family/
* c.opt (Wpedantic): New.
(pedantic): Alias Wpedantic.
* c-opts.c (c_common_handle_option): Replace -pedantic with -Wpedantic.
(c_common_post_options): Likewise.
(sanitize_cpp_opts): Likewise.
* c-lex.c (interpret_float): Likewise.
* c-format.c (check_format_types): Likewise.
* c-common.c (pointer_int_sum): Likewise.
(c_sizeof_or_alignof_type): Likewise.
(c_add_case_label): Likewise.
(c_do_switch_warnings): Likewise.
* c-pragma.c (handle_pragma_float_const_decimal64): Likewise.
cp/
* typeck.c (composite_pointer_type): Likewise.
(cxx_sizeof_or_alignof_type): Likewise.
(cp_build_array_ref): Likewise.
(cp_build_function_call_vec): Likewise.
(cp_build_addr_expr_1): Likewise.
(convert_member_func_to_ptr): Likewise.
* decl.c (check_tag_decl): Likewise.
(check_static_variable_definition): Likewise.
(compute_array_index_type): Likewise.
(create_array_type_for_decl): Likewise.
(grokdeclarator): Likewise.
(grok_op_properties): Likewise.
* error.c (maybe_warn_cpp0x): Likewise.
* pt.c (maybe_process_partial_specialization): Likewise.
(convert_template_argument): Likewise.
(do_decl_instantiation): Likewise.
(do_type_instantiation): Likewise.
* parser.c (cp_parser_primary_expression): Likewise.
(cp_parser_postfix_expression): Likewise.
(cp_parser_unary_expression): Likewise.
(cp_parser_question_colon_clause): Likewise.
(cp_parser_lambda_introducer): Likewise.
(cp_parser_lambda_declarator_opt): Likewise.
(cp_parser_compound_statement): Likewise.
(cp_parser_jump_statement): Likewise.
(cp_parser_declaration_seq_opt): Likewise.
(cp_parser_enum_specifier): Likewise.
(cp_parser_enumerator_list): Likewise.
(cp_parser_initializer_list): Likewise.
(cp_parser_member_declaration): Likewise.
* call.c (build_conditional_expr_1): Likewise.
* friend.c (make_friend_class): Likewise.
* name-lookup.c (pushdecl_maybe_friend_1): Likewise.
From-SVN: r186681
Diffstat (limited to 'gcc/cp/parser.c')
-rw-r--r-- | gcc/cp/parser.c | 30 |
1 files changed, 15 insertions, 15 deletions
diff --git a/gcc/cp/parser.c b/gcc/cp/parser.c index 8aefefa..3b5a476 100644 --- a/gcc/cp/parser.c +++ b/gcc/cp/parser.c @@ -4011,7 +4011,7 @@ 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 (token->location, OPT_pedantic, + pedwarn (token->location, OPT_Wpedantic, "ISO C++ forbids braced-groups within expressions"); /* And they're not allowed outside of a function-body; you @@ -5550,7 +5550,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 (input_location, OPT_pedantic, "ISO C++ forbids compound-literals"); + pedwarn (input_location, OPT_Wpedantic, "ISO C++ forbids compound-literals"); /* For simplicity, we disallow compound literals in constant-expressions. We could allow compound literals of integer type, whose @@ -6393,7 +6393,7 @@ cp_parser_unary_expression (cp_parser *parser, bool address_p, bool cast_p, expressions. So pedwarn if alignof is used with a non- type expression. However, __alignof__ is ok. */ if (!strcmp (IDENTIFIER_POINTER (token->u.value), "alignof")) - pedwarn (token->location, OPT_pedantic, + pedwarn (token->location, OPT_Wpedantic, "ISO C++ does not allow %<alignof%> " "with a non-type"); @@ -7434,7 +7434,7 @@ cp_parser_question_colon_clause (cp_parser* parser, tree logical_or_expr) if (cp_parser_allow_gnu_extensions_p (parser) && token->type == CPP_COLON) { - pedwarn (token->location, OPT_pedantic, + pedwarn (token->location, OPT_Wpedantic, "ISO C++ does not allow ?: with omitted middle operand"); /* Implicit true clause. */ expr = NULL_TREE; @@ -8238,7 +8238,7 @@ cp_parser_lambda_introducer (cp_parser* parser, tree lambda_expr) { /* An explicit expression exists. */ cp_lexer_consume_token (parser->lexer); - pedwarn (input_location, OPT_pedantic, + pedwarn (input_location, OPT_Wpedantic, "ISO C++ does not allow initializers " "in lambda expression capture lists"); capture_init_expr = cp_parser_assignment_expression (parser, @@ -8368,7 +8368,7 @@ cp_parser_lambda_declarator_opt (cp_parser* parser, tree lambda_expr) parameter-declaration-clause of a lambda-declarator. */ for (t = param_list; t; t = TREE_CHAIN (t)) if (TREE_PURPOSE (t)) - pedwarn (DECL_SOURCE_LOCATION (TREE_VALUE (t)), OPT_pedantic, + pedwarn (DECL_SOURCE_LOCATION (TREE_VALUE (t)), OPT_Wpedantic, "default argument specified for lambda parameter"); cp_parser_require (parser, CPP_CLOSE_PAREN, RT_CLOSE_PAREN); @@ -8939,7 +8939,7 @@ cp_parser_compound_statement (cp_parser *parser, tree in_statement_expr, return error_mark_node; if (DECL_DECLARED_CONSTEXPR_P (current_function_decl) && !function_body) - pedwarn (input_location, OPT_pedantic, + pedwarn (input_location, OPT_Wpedantic, "compound-statement in constexpr function"); /* Begin the compound-statement. */ compound_stmt = begin_compound_stmt (in_try ? BCS_TRY_BLOCK : 0); @@ -9910,7 +9910,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 (token->location, OPT_pedantic, "ISO C++ forbids computed gotos"); + pedwarn (token->location, OPT_Wpedantic, "ISO C++ forbids computed gotos"); /* Consume the '*' token. */ cp_lexer_consume_token (parser->lexer); /* Parse the dependent expression. */ @@ -10055,7 +10055,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 (input_location, OPT_pedantic, "extra %<;%>"); + pedwarn (input_location, OPT_Wpedantic, "extra %<;%>"); continue; } @@ -14362,7 +14362,7 @@ cp_parser_enum_specifier (cp_parser* parser) { /* Are template enums allowed in ISO? */ if (template_parm_scope_p ()) - pedwarn (type_start_token->location, OPT_pedantic, + pedwarn (type_start_token->location, OPT_Wpedantic, "%qD is an enumeration template", name); /* ignore a typename reference, for it will be solved by name in start_enum. */ @@ -14615,7 +14615,7 @@ cp_parser_enumerator_list (cp_parser* parser, tree type) if (cp_lexer_next_token_is (parser->lexer, CPP_CLOSE_BRACE)) { if (cxx_dialect < cxx0x && !in_system_header) - pedwarn (input_location, OPT_pedantic, + pedwarn (input_location, OPT_Wpedantic, "comma at end of enumerator list"); break; } @@ -17634,7 +17634,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 (input_location, OPT_pedantic, + pedwarn (input_location, OPT_Wpedantic, "ISO C++ does not allow designated initializers"); /* Consume the identifier. */ designator = cp_lexer_consume_token (parser->lexer)->u.value; @@ -17648,7 +17648,7 @@ cp_parser_initializer_list (cp_parser* parser, bool* non_constant_p) && cp_lexer_peek_nth_token (parser->lexer, 3)->type == CPP_EQ) { /* Warn the user that they are using an extension. */ - pedwarn (input_location, OPT_pedantic, + pedwarn (input_location, OPT_Wpedantic, "ISO C++ does not allow C99 designated initializers"); /* Consume the `.'. */ cp_lexer_consume_token (parser->lexer); @@ -18864,7 +18864,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 (token->location, OPT_pedantic, "extra %<;%>"); + pedwarn (token->location, OPT_Wpedantic, "extra %<;%>"); } else { @@ -18882,7 +18882,7 @@ cp_parser_member_declaration (cp_parser* parser) /* If the `friend' keyword was present, the friend must be introduced with a class-key. */ if (!declares_class_or_enum && cxx_dialect < cxx0x) - pedwarn (decl_spec_token_start->location, OPT_pedantic, + pedwarn (decl_spec_token_start->location, OPT_Wpedantic, "in C++03 a class-key must be used " "when declaring a friend"); /* In this case: |