On 5/14/19 3:32 PM, Martin Sebor wrote:
> The attached patch fixes quoting, spelling, and other formatting
> issues in diagnostics issued by the C++ front-end and pointed out
> by the -Wformat-diag warning.
> 
> Martin
> 
> gcc-wformat-diag-cp.diff
> 
> gcc/cp/ChangeLog:
> 
>       * call.c (print_z_candidate): Wrap diagnostic text in a gettext
>       macro.  Adjust.
>       (print_z_candidates): Same.
>       (build_conditional_expr_1): Quote keywords, operators, and types
>       in diagnostics.
>       (build_op_delete_call): Same.
>       (maybe_print_user_conv_context): Wrap diagnostic text in a gettext
>       macro.
>       (convert_like_real): Same.
>       (convert_arg_to_ellipsis): Quote keywords, operators, and types
>       in diagnostics.
>       (build_over_call): Same.
>       (joust): Break up an overlong line.  Wrap diagnostic text in a gettext
>       macro.
>       * constexpr.c (cxx_eval_check_shift_p): Spell out >= in English.
>       (cxx_eval_constant_expression): Quote keywords, operators, and types
>       in diagnostics.
>       (potential_constant_expression_1): Same.
>       * cp-gimplify.c (cp_genericize_r): Same.
>       * cp-tree.h (GCC_DIAG_STYLE): Adjust.
>       (GCC_DIAG_RAW_STYLE): New macro.
>       * cvt.c (maybe_warn_nodiscard): Quote keywords, operators, and types
>       in diagnostics.
>       (type_promotes_to): Same.
>       * decl.c (check_previous_goto_1): Same.
>       (check_goto): Same.
>       (start_decl): Same.
>       (cp_finish_decl): Avoid parenthesizing a sentence for consistency.
>       (grok_op_properties): Quote keywords, operators, and types
>       in diagnostics.
>       * decl2.c (grokfield): Same.
>       (coerce_delete_type): Same.
>       * except.c (is_admissible_throw_operand_or_catch_parameter): Same.
>       * friend.c (do_friend): Quote C++ tokens.
>       * init.c (build_new_1): Quote keywords, operators, and types
>       in diagnostics.
>       (build_vec_delete_1): Same.
>       (build_delete): Same.
>       * lex.c (parse_strconst_pragma): Same.
>       (handle_pragma_implementation): Same.
>       (unqualified_fn_lookup_error): Same.
>       * mangle.c (write_type): Same.
>       * method.c (defaulted_late_check): Avoid two consecutive punctuators.
>       * name-lookup.c (cp_binding_level_debug): Remove a trailing newline.
>       (pop_everything): Same.
>       * parser.c (cp_lexer_start_debugging): Quote a macro name.
>       in a diagnostic
>       (cp_lexer_stop_debugging): Same.
>       (cp_parser_userdef_numeric_literal): Quote a C++ header name
>       in a diagnostic.
>       (cp_parser_nested_name_specifier_opt): Quote keywords, operators,
>       and types in diagnostics.
>       (cp_parser_question_colon_clause): Same.
>       (cp_parser_asm_definition): Same.
>       (cp_parser_init_declarator): Same.
>       (cp_parser_template_declaration_after_parameters): Avoid capitalizing
>       a sentence in a diagnostic.
>       (cp_parser_omp_declare_reduction): Quote keywords, operators, and types
>       in diagnostics.
>       (cp_parser_transaction): Same.
>       * pt.c (maybe_process_partial_specialization): Replace second call
>       to permerror with inform for consistency with other uses.
>       (expand_integer_pack): Quote keywords, operators, and types
>       in diagnostics.
>       * rtti.c (get_typeid): Quote keywords, operators, and types
>       in diagnostics.
>       (build_dynamic_cast_1): Same.
>       * semantics.c (finish_asm_stmt): Same.
>       (finish_label_decl): Same.
>       (finish_bases): Same.
>       (finish_offsetof): Same.
>       (cp_check_omp_declare_reduction): Same.
>       (finish_decltype_type): Same.
>       * tree.c (handle_init_priority_attribute): Same.  Add detail
>       to diagnostics.
>       (maybe_warn_zero_as_null_pointer_constant): Same.
>       * typeck.c (cp_build_binary_op): Quote keywords, operators, and types
>       in diagnostics.
>       (cp_build_unary_op): Same.
>       (check_for_casting_away_constness): Same.
>       (build_static_cast): Same.
>       (build_const_cast_1): Same.
>       (maybe_warn_about_returning_address_of_local): Same.
>       (check_return_expr): Same.
>       * typeck2.c (abstract_virtuals_error_sfinae): Same.
>       (digest_init_r): Replace a tab with spaces in a diagnostic.
>       (build_functional_cast): Quote keywords, operators, and types
>       in diagnostics.
OK.

Jeff

Reply via email to