Commit 787e2deb by Jakub Jelinek Committed by Jakub Jelinek

re PR c++/89105 (-Wabi warns for functions with internal linkage)

	PR c++/89105
	* config/i386/i386.c (ix86_warn_parameter_passing_abi): Don't warn
	for arguments to functions that are TU-local and shouldn't be
	referenced by assembly.

	* g++.target/i386/pr89105.C: New test.

From-SVN: r268382
parent fe509359
2019-01-30 Jakub Jelinek <jakub@redhat.com>
PR c++/89105
* config/i386/i386.c (ix86_warn_parameter_passing_abi): Don't warn
for arguments to functions that are TU-local and shouldn't be
referenced by assembly.
2019-01-30 Ulrich Drepper <drepper@redhat.com>
* dumpfile.c (opt_info_switch_p_1): Ignore '-' if it appears
......
......@@ -29562,6 +29562,10 @@ ix86_warn_parameter_passing_abi (cumulative_args_t cum_v, tree type)
if (!TYPE_EMPTY_P (type))
return;
/* Don't warn if the function isn't visible outside of the TU. */
if (cum->decl && !TREE_PUBLIC (cum->decl))
return;
const_tree ctx = get_ultimate_context (cum->decl);
if (ctx != NULL_TREE
&& !TRANSLATION_UNIT_WARN_EMPTY_P (ctx))
2019-01-30 Jakub Jelinek <jakub@redhat.com>
PR c++/89105
* g++.target/i386/pr89105.C: New test.
PR c/89061
* gcc.dg/pr89061.c: New test.
......
// PR c++/89105
// { dg-do compile { target c++11 } }
// { dg-options "-fabi-version=12 -Wabi=11" }
namespace {
template<typename F>
void run(F f, int i) // { dg-bogus "parameter passing ABI changes in -fabi-version=12" }
{
f(i);
}
}
void f()
{
run([](int) { }, 1); // { dg-bogus "parameter passing ABI changes in -fabi-version=12" }
}
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