From: jason Date: Fri, 15 Jun 2018 20:22:38 +0000 (+0000) Subject: * tree.c (maybe_warn_parm_abi): Inform the location of the class. X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=a705bb9efbfc65fb05e8b865a2a07d10b8099a25;p=thirdparty%2Fgcc.git * tree.c (maybe_warn_parm_abi): Inform the location of the class. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@261653 138bc75d-0d04-0410-961f-82ee72b054a4 --- diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog index f465dae12c06..2679ca6f1e8e 100644 --- a/gcc/cp/ChangeLog +++ b/gcc/cp/ChangeLog @@ -1,3 +1,7 @@ +2018-06-15 Jason Merrill + + * tree.c (maybe_warn_parm_abi): Inform the location of the class. + 2018-06-14 Marek Polacek PR c++/86063 diff --git a/gcc/cp/tree.c b/gcc/cp/tree.c index 48a0ff373720..a88481db1e0d 100644 --- a/gcc/cp/tree.c +++ b/gcc/cp/tree.c @@ -4074,25 +4074,23 @@ maybe_warn_parm_abi (tree t, location_t loc) if ((flag_abi_version == 12 || warn_abi_version == 12) && classtype_has_non_deleted_move_ctor (t)) { + bool w; if (flag_abi_version > 12) - warning_at (loc, OPT_Wabi, "-fabi-version=13 (GCC 8.2) fixes the " - "calling convention for %qT, which was accidentally " - "changed in 8.1", t); + w = warning_at (loc, OPT_Wabi, "-fabi-version=13 (GCC 8.2) fixes the " + "calling convention for %qT, which was accidentally " + "changed in 8.1", t); else - warning_at (loc, OPT_Wabi, "-fabi-version=12 (GCC 8.1) accidentally " - "changes the calling convention for %qT", t); + w = warning_at (loc, OPT_Wabi, "-fabi-version=12 (GCC 8.1) accident" + "ally changes the calling convention for %qT", t); + if (w) + inform (location_of (t), " declared here"); return; } - warning_at (loc, OPT_Wabi, "the calling convention for %qT changes in " - "-fabi-version=13 (GCC 8.2)", t); - static bool explained = false; - if (!explained) - { - inform (loc, " because all of its copy and move constructors " - "are deleted"); - explained = true; - } + if (warning_at (loc, OPT_Wabi, "the calling convention for %qT changes in " + "-fabi-version=13 (GCC 8.2)", t)) + inform (location_of (t), " because all of its copy and move " + "constructors are deleted"); } /* Returns true iff copying an object of type T (including via move diff --git a/gcc/testsuite/g++.dg/abi/invisiref2a.C b/gcc/testsuite/g++.dg/abi/invisiref2a.C index 053305532877..127ee0ae7639 100644 --- a/gcc/testsuite/g++.dg/abi/invisiref2a.C +++ b/gcc/testsuite/g++.dg/abi/invisiref2a.C @@ -3,7 +3,7 @@ // { dg-additional-options "-fabi-version=12 -Wabi -fdump-tree-gimple" } // { dg-final { scan-tree-dump "struct S &" "gimple" } } -struct S { +struct S { // { dg-message "" } S(S&&) = default; int i; };