diff options
author | Jason Merrill <jason@redhat.com> | 2018-06-15 16:22:38 -0400 |
---|---|---|
committer | Jason Merrill <jason@gcc.gnu.org> | 2018-06-15 16:22:38 -0400 |
commit | 508f1cb51f5872f425a3d4eb3ab8bf5a76a692ac (patch) | |
tree | ce10e4b1922fbffbdf0afd8ebee4db794ff349ad /gcc | |
parent | b8d850056860ea8cdc47234d3fbf89c8d03c9342 (diff) | |
download | gcc-508f1cb51f5872f425a3d4eb3ab8bf5a76a692ac.zip gcc-508f1cb51f5872f425a3d4eb3ab8bf5a76a692ac.tar.gz gcc-508f1cb51f5872f425a3d4eb3ab8bf5a76a692ac.tar.bz2 |
* tree.c (maybe_warn_parm_abi): Inform the location of the class.
From-SVN: r261653
Diffstat (limited to 'gcc')
-rw-r--r-- | gcc/cp/ChangeLog | 4 | ||||
-rw-r--r-- | gcc/cp/tree.c | 26 | ||||
-rw-r--r-- | gcc/testsuite/g++.dg/abi/invisiref2a.C | 2 |
3 files changed, 17 insertions, 15 deletions
diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog index f465dae..2679ca6 100644 --- a/gcc/cp/ChangeLog +++ b/gcc/cp/ChangeLog @@ -1,3 +1,7 @@ +2018-06-15 Jason Merrill <jason@redhat.com> + + * tree.c (maybe_warn_parm_abi): Inform the location of the class. + 2018-06-14 Marek Polacek <polacek@redhat.com> PR c++/86063 diff --git a/gcc/cp/tree.c b/gcc/cp/tree.c index 48a0ff3..a88481d 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 0533055..127ee0a 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; }; |