Commit 508f1cb5 by Jason Merrill Committed by Jason Merrill

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

From-SVN: r261653
parent b8d85005
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> 2018-06-14 Marek Polacek <polacek@redhat.com>
PR c++/86063 PR c++/86063
......
...@@ -4074,25 +4074,23 @@ maybe_warn_parm_abi (tree t, location_t loc) ...@@ -4074,25 +4074,23 @@ maybe_warn_parm_abi (tree t, location_t loc)
if ((flag_abi_version == 12 || warn_abi_version == 12) if ((flag_abi_version == 12 || warn_abi_version == 12)
&& classtype_has_non_deleted_move_ctor (t)) && classtype_has_non_deleted_move_ctor (t))
{ {
bool w;
if (flag_abi_version > 12) if (flag_abi_version > 12)
warning_at (loc, OPT_Wabi, "-fabi-version=13 (GCC 8.2) fixes the " w = warning_at (loc, OPT_Wabi, "-fabi-version=13 (GCC 8.2) fixes the "
"calling convention for %qT, which was accidentally " "calling convention for %qT, which was accidentally "
"changed in 8.1", t); "changed in 8.1", t);
else else
warning_at (loc, OPT_Wabi, "-fabi-version=12 (GCC 8.1) accidentally " w = warning_at (loc, OPT_Wabi, "-fabi-version=12 (GCC 8.1) accident"
"changes the calling convention for %qT", t); "ally changes the calling convention for %qT", t);
if (w)
inform (location_of (t), " declared here");
return; return;
} }
warning_at (loc, OPT_Wabi, "the calling convention for %qT changes in " if (warning_at (loc, OPT_Wabi, "the calling convention for %qT changes in "
"-fabi-version=13 (GCC 8.2)", t); "-fabi-version=13 (GCC 8.2)", t))
static bool explained = false; inform (location_of (t), " because all of its copy and move "
if (!explained) "constructors are deleted");
{
inform (loc, " because all of its copy and move constructors "
"are deleted");
explained = true;
}
} }
/* Returns true iff copying an object of type T (including via move /* Returns true iff copying an object of type T (including via move
......
...@@ -3,7 +3,7 @@ ...@@ -3,7 +3,7 @@
// { dg-additional-options "-fabi-version=12 -Wabi -fdump-tree-gimple" } // { dg-additional-options "-fabi-version=12 -Wabi -fdump-tree-gimple" }
// { dg-final { scan-tree-dump "struct S &" "gimple" } } // { dg-final { scan-tree-dump "struct S &" "gimple" } }
struct S { struct S { // { dg-message "" }
S(S&&) = default; S(S&&) = default;
int i; int i;
}; };
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment