diff options
author | paolo <paolo@138bc75d-0d04-0410-961f-82ee72b054a4> | 2015-07-28 08:53:57 +0000 |
---|---|---|
committer | paolo <paolo@138bc75d-0d04-0410-961f-82ee72b054a4> | 2015-07-28 08:53:57 +0000 |
commit | 66ed189dce802c9fc8b0dcae0e6ead6046651af6 (patch) | |
tree | 2987b10cfbacbefc9e2d2add7920cf04f3aff46a /gcc/cp/method.c | |
parent | 95328f382d997be538eb74889fe80332b5e38b91 (diff) | |
download | gcc-66ed189dce802c9fc8b0dcae0e6ead6046651af6.tar.gz |
2015-07-28 Paolo Carlini <paolo.carlini@oracle.com>
* call.c (build_op_delete_call, convert_like_real, build_over_call):
Use Use DECL_SOURCE_LOCATION and "%qD" in inform and pedwarn instead
of "%q+D".
* constexpr.c (explain_invalid_constexpr_fn): Likewise.
* decl.c (duplicate_decls): Likewise for warning/warning_at.
* except.c (maybe_noexcept_warning): Likewise.
* friend.c (make_friend_class): Likewise for inform.
* mangle.c (mangle_decl): Likewise for warning/warning_at.
* method.c (process_subob_fn, walk_field_subobs,
maybe_explain_implicit_delete): Likewise for inform.
* parser.c (cp_parser_lambda_introducer): Likewise.
* pt.c (check_specialization_namespace,
maybe_process_partial_specialization): Likewise for permerror.
(redeclare_class_template): Likewise for inform_n.
(coerce_template_parms, tsubst_copy_and_build): Likewise for inform.
* search.c (check_final_overrider): Likewise.
* semantics.c (process_outer_var_ref): Likewise.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@226308 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/cp/method.c')
-rw-r--r-- | gcc/cp/method.c | 22 |
1 files changed, 13 insertions, 9 deletions
diff --git a/gcc/cp/method.c b/gcc/cp/method.c index 570f800f7c2..7d7ec7da187 100644 --- a/gcc/cp/method.c +++ b/gcc/cp/method.c @@ -1138,8 +1138,8 @@ process_subob_fn (tree fn, tree *spec_p, bool *trivial_p, *constexpr_p = false; if (diag) { - inform (0, "defaulted constructor calls non-constexpr " - "%q+D", fn); + inform (DECL_SOURCE_LOCATION (fn), + "defaulted constructor calls non-constexpr %qD", fn); explain_invalid_constexpr_fn (fn); } } @@ -1199,7 +1199,8 @@ walk_field_subobs (tree fields, tree fnname, special_function_kind sfk, if (DECL_INITIAL (field)) { if (diag && DECL_INITIAL (field) == error_mark_node) - inform (0, "initializer for %q+#D is invalid", field); + inform (DECL_SOURCE_LOCATION (field), + "initializer for %q#D is invalid", field); if (trivial_p) *trivial_p = false; /* Core 1351: If the field has an NSDMI that could throw, the @@ -1250,8 +1251,9 @@ walk_field_subobs (tree fields, tree fnname, special_function_kind sfk, { *constexpr_p = false; if (diag) - inform (0, "defaulted default constructor does not " - "initialize %q+#D", field); + inform (DECL_SOURCE_LOCATION (field), + "defaulted default constructor does not " + "initialize %q#D", field); } } else if (sfk == sfk_copy_constructor) @@ -1615,9 +1617,10 @@ maybe_explain_implicit_delete (tree decl) && (type_has_user_declared_move_constructor (ctype) || type_has_user_declared_move_assign (ctype))) { - inform (0, "%q+#D is implicitly declared as deleted because %qT " - "declares a move constructor or move assignment operator", - decl, ctype); + inform (DECL_SOURCE_LOCATION (decl), + "%q#D is implicitly declared as deleted because %qT " + "declares a move constructor or move assignment operator", + decl, ctype); informed = true; } if (!informed) @@ -1634,7 +1637,8 @@ maybe_explain_implicit_delete (tree decl) DECL_INHERITED_CTOR_BASE (decl), parms); if (deleted_p) { - inform (0, "%q+#D is implicitly deleted because the default " + inform (DECL_SOURCE_LOCATION (decl), + "%q#D is implicitly deleted because the default " "definition would be ill-formed:", decl); synthesized_method_walk (ctype, sfk, const_p, NULL, NULL, NULL, NULL, true, |