diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog index 09df98f77068..bea717b65fe8 100644 --- a/gcc/cp/ChangeLog +++ b/gcc/cp/ChangeLog @@ -1,9 +1,27 @@ +2004-10-31 Gabriel Dos Reis + + Convert diagnostics to use quoting flag q 9/n + * typeck.c (build_x_unary_op, convert_member_func_to_ptr, + get_delta_difference): Use new quotation style. + * repo.c (reopen_repo_file_for_write): Likewise. + * pt.c (do_type_instantiation): Likewise. + * parser.c (cp_parser_diagnose_invalid_type_name): + * name-lookup.c (push_overloaded_decl, set_decl_namespace): + * error.c (cp_print_error_function, + print_instantiation_full_context): Likewise. + * decl.c (define_label, grok_reference_init, + maybe_deduce_size_from_array_init, revert_static_member_fn): + * decl2.c (check_classfn): Likewise. + * class.c (add_method, check_field_decls, layout_class_type, + resolve_address_of_overloaded_function): Likewise. + * call.c (build_x_va_arg, build_over_call): Likewise. + 2004-10-31 Gabriel Dos Reis Convert diagnostics to use quoting flag q 8/n * cvt.c (cp_convert_to_pointer, warn_ref_binding, convert_to_reference, ocp_convert, convert_to_void - cp_convert_to_pointer): + cp_convert_to_pointer): Use new quotation style. 2004-10-31 Mark Mitchell diff --git a/gcc/cp/call.c b/gcc/cp/call.c index 9ff5b7ca3b1d..3c726432f8e4 100644 --- a/gcc/cp/call.c +++ b/gcc/cp/call.c @@ -4429,7 +4429,7 @@ build_x_va_arg (tree expr, tree type) if (! pod_type_p (type)) { /* Undefined behavior [expr.call] 5.2.2/7. */ - warning ("cannot receive objects of non-POD type %q#T' through %<...%>; " + warning ("cannot receive objects of non-POD type %q#T through %<...%>; " "call will abort at runtime", type); expr = convert (build_pointer_type (type), null_node); expr = build2 (COMPOUND_EXPR, TREE_TYPE (expr), @@ -4677,8 +4677,8 @@ build_over_call (struct z_candidate *cand, int flags) tree base_binfo; if (convs[i]->bad_p) - pedwarn ("passing `%T' as `this' argument of `%#D' discards qualifiers", - TREE_TYPE (argtype), fn); + pedwarn ("passing %qT as % argument of %q#D discards qualifiers", + TREE_TYPE (argtype), fn); /* [class.mfct.nonstatic]: If a nonstatic member function of a class X is called for an object that is not of type X, or of a type diff --git a/gcc/cp/class.c b/gcc/cp/class.c index 15ca26ad4602..c21d4411a020 100644 --- a/gcc/cp/class.c +++ b/gcc/cp/class.c @@ -995,7 +995,7 @@ add_method (tree type, tree method) return; else { - cp_error_at ("`%#D' and `%#D' cannot be overloaded", + cp_error_at ("%q#D and %q#D cannot be overloaded", method, fn); /* We don't call duplicate_decls here to merge @@ -2872,7 +2872,8 @@ check_field_decls (tree t, tree *access_decls, } if (TREE_CODE (type) == REFERENCE_TYPE) { - cp_error_at ("%qD may not have reference type `%T' because it is a member of a union", + cp_error_at ("%qD may not have reference type %qT because" + " it is a member of a union", x, type); continue; } @@ -4599,7 +4600,7 @@ layout_class_type (tree t, tree *virtuals_p) else { if (warn_abi && TREE_CODE (t) == UNION_TYPE) - warning ("size assigned to `%T' may not be " + warning ("size assigned to %qT may not be " "ABI-compliant and may change in a future " "version of GCC", t); @@ -5615,9 +5616,9 @@ resolve_address_of_overloaded_function (tree target_type, else { if (flags & tf_error) - error ("\ -cannot resolve overloaded function `%D' based on conversion to type `%T'", - DECL_NAME (OVL_FUNCTION (overload)), target_type); + error ("cannot resolve overloaded function %qD based on" + " conversion to type %qT", + DECL_NAME (OVL_FUNCTION (overload)), target_type); return error_mark_node; } diff --git a/gcc/cp/decl.c b/gcc/cp/decl.c index 63227df57396..479914905f53 100644 --- a/gcc/cp/decl.c +++ b/gcc/cp/decl.c @@ -2416,7 +2416,7 @@ define_label (location_t location, tree name) pedwarn ("label named wchar_t"); if (DECL_INITIAL (decl) != NULL_TREE) - error ("duplicate label `%D'", decl); + error ("duplicate label %qD", decl); else { /* Mark label as having been defined. */ @@ -3936,7 +3936,7 @@ grok_reference_init (tree decl, tree type, tree init, tree *cleanup) if ((DECL_LANG_SPECIFIC (decl) == 0 || DECL_IN_AGGR_P (decl) == 0) && ! DECL_THIS_EXTERN (decl)) - error ("`%D' declared as reference but not initialized", decl); + error ("%qD declared as reference but not initialized", decl); return NULL_TREE; } @@ -4008,7 +4008,7 @@ maybe_deduce_size_from_array_init (tree decl, tree init) if (failure == 2) { if (do_default) - error ("array size missing in `%D'", decl); + error ("array size missing in %qD", decl); /* If a `static' var's size isn't known, make it extern as well as static, so it does not get allocated. If it's not `static', then don't mark it extern; finish_incomplete_decl @@ -10970,8 +10970,7 @@ revert_static_member_fn (tree decl) if (cp_type_quals (TREE_TYPE (TREE_VALUE (args))) != TYPE_UNQUALIFIED) - error ("static member function `%#D' declared with type qualifiers", - decl); + error ("static member function %q#D declared with type qualifiers", decl); args = TREE_CHAIN (args); tmp = build_function_type (TREE_TYPE (function), args); diff --git a/gcc/cp/decl2.c b/gcc/cp/decl2.c index 32ee18a55ebc..310f386d48f4 100644 --- a/gcc/cp/decl2.c +++ b/gcc/cp/decl2.c @@ -674,7 +674,7 @@ check_classfn (tree ctype, tree function, tree template_parms) pop_scope (ctype); if (fndecls) return OVL_CURRENT (fndecls); - error ("prototype for `%#D' does not match any in class `%T'", + error ("prototype for %q#D does not match any in class %qT", function, ctype); is_conv_op = DECL_CONV_FN_P (fndecl); diff --git a/gcc/cp/error.c b/gcc/cp/error.c index a5861124947b..9c7642a533ff 100644 --- a/gcc/cp/error.c +++ b/gcc/cp/error.c @@ -2152,7 +2152,7 @@ cp_print_error_function (diagnostic_context *context, if (current_function_decl == NULL) pp_base_string (context->printer, "At global scope:"); else - pp_printf (context->printer, "In %s `%s':", + pp_printf (context->printer, "In %s %qs:", function_category (current_function_decl), cxx_printable_name (current_function_decl, 2)); pp_base_newline (context->printer); @@ -2206,7 +2206,7 @@ print_instantiation_full_context (diagnostic_context *context) /* Avoid redundancy with the the "In function" line. */; else pp_verbatim (context->printer, - "%s: In instantiation of `%s':\n", + "%s: In instantiation of %qs:\n", LOCATION_FILE (location), decl_as_string (TINST_DECL (p), TFF_DECL_SPECIFIERS | TFF_RETURN_TYPE)); diff --git a/gcc/cp/name-lookup.c b/gcc/cp/name-lookup.c index 7dc19f824be2..33e745df4599 100644 --- a/gcc/cp/name-lookup.c +++ b/gcc/cp/name-lookup.c @@ -2008,7 +2008,7 @@ push_overloaded_decl (tree decl, int flags) if (IS_AGGR_TYPE (t) && warn_shadow && (! DECL_IN_SYSTEM_HEADER (decl) || ! DECL_IN_SYSTEM_HEADER (old))) - warning ("`%#D' hides constructor for `%#T'", decl, t); + warning ("%q#D hides constructor for %q#T", decl, t); old = NULL_TREE; } else if (is_overloaded_fn (old)) @@ -3000,8 +3000,8 @@ set_decl_namespace (tree decl, tree scope, bool friendp) /* It is ok for friends to be qualified in parallel space. */ if (!friendp && !is_ancestor (current_namespace, scope)) - error ("declaration of `%D' not in a namespace surrounding `%D'", - decl, scope); + error ("declaration of %qD not in a namespace surrounding %qD", + decl, scope); DECL_CONTEXT (decl) = FROB_CONTEXT (scope); if (scope != current_namespace) { diff --git a/gcc/cp/parser.c b/gcc/cp/parser.c index 8fed7ba9da82..e2afb3b192b2 100644 --- a/gcc/cp/parser.c +++ b/gcc/cp/parser.c @@ -1990,7 +1990,7 @@ cp_parser_diagnose_invalid_type_name (cp_parser *parser, tree scope, tree id) if (TREE_CODE (field) == TYPE_DECL && DECL_NAME (field) == id) { - inform ("(perhaps `typename %T::%E' was intended)", + inform ("(perhaps % was intended)", BINFO_TYPE (b), id); break; } diff --git a/gcc/cp/pt.c b/gcc/cp/pt.c index 54925a513d86..56f55ed53565 100644 --- a/gcc/cp/pt.c +++ b/gcc/cp/pt.c @@ -10843,7 +10843,7 @@ do_type_instantiation (tree t, tree storage, tsubst_flags_t complain) if (storage != NULL_TREE) { if (pedantic && !in_system_header) - pedwarn("ISO C++ forbids the use of `%E' on explicit instantiations", + pedwarn("ISO C++ forbids the use of %qE on explicit instantiations", storage); if (storage == ridpointers[(int) RID_INLINE]) diff --git a/gcc/cp/repo.c b/gcc/cp/repo.c index 7f178f9089b5..6675980bd561 100644 --- a/gcc/cp/repo.c +++ b/gcc/cp/repo.c @@ -211,7 +211,7 @@ reopen_repo_file_for_write (void) if (repo_file == 0) { - error ("can't create repository information file `%s'", repo_name); + error ("can't create repository information file %qs", repo_name); flag_use_repository = 0; } } diff --git a/gcc/cp/typeck.c b/gcc/cp/typeck.c index 6593a65beaad..3796acee56f9 100644 --- a/gcc/cp/typeck.c +++ b/gcc/cp/typeck.c @@ -3620,13 +3620,15 @@ build_x_unary_op (enum tree_code code, tree xarg) { if (TREE_CODE (xarg) != OFFSET_REF) { - error ("invalid use of '%E' to form a pointer-to-member-function. Use a qualified-id.", + error ("invalid use of %qE to form a pointer-to-member-function." + " Use a qualified-id.", xarg); return error_mark_node; } else { - error ("parenthesis around '%E' cannot be used to form a pointer-to-member-function", + error ("parenthesis around %qE cannot be used to form a" + " pointer-to-member-function", xarg); PTRMEM_OK_P (xarg) = 1; } @@ -4802,7 +4804,7 @@ convert_member_func_to_ptr (tree type, tree expr) || TREE_CODE (intype) == METHOD_TYPE); if (pedantic || warn_pmf2ptr) - pedwarn ("converting from `%T' to `%T'", intype, type); + pedwarn ("converting from %qT to %qT", intype, type); if (TREE_CODE (intype) == METHOD_TYPE) expr = build_addr_func (expr); @@ -5595,7 +5597,7 @@ get_delta_difference (tree from, tree to, virt_binfo = binfo_from_vbase (binfo); if (virt_binfo) /* This is a reinterpret cast, we choose to do nothing. */ - warning ("pointer to member cast via virtual base `%T'", + warning ("pointer to member cast via virtual base %qT", BINFO_TYPE (virt_binfo)); else result = size_diffop (size_zero_node, BINFO_OFFSET (binfo));