* tree.c (maybe_warn_parm_abi): Inform the location of the class.

From-SVN: r261653
This commit is contained in:
Jason Merrill 2018-06-15 16:22:38 -04:00 committed by Jason Merrill
parent b8d8500568
commit 508f1cb51f
3 changed files with 17 additions and 15 deletions

View file

@ -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

View file

@ -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

View file

@ -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;
};