Commit 60214d0d by Martin Sebor Committed by Martin Sebor

PR c++/69317 - [6 regression] wrong ABI version in -Wabi warnings

gcc/cp/ChangeLog:
2016-01-27  Martin Sebor  <msebor@redhat.com>

	PR c++/69317
	* mangle.c (mangle_decl): Reference the correct (saved) version
	of the ABI in -Wabi diagnostics.

gcc/testsuite/ChangeLog:
2016-01-27  Martin Sebor  <msebor@redhat.com>

	PR c++/69317
	* g++.dg/abi/Wabi-2-2.C: New test.
	* g++.dg/abi/Wabi-2-3.C: New test.
	* g++.dg/abi/Wabi-3-2.C: New test.
	* g++.dg/abi/Wabi-3-3.C: New test.

From-SVN: r232881
parent 960cbfd2
2016-01-27 Martin Sebor <msebor@redhat.com>
PR c++/69317
* mangle.c (mangle_decl): Reference the correct (saved) version
of the ABI in -Wabi diagnostics.
2016-01-27 Marek Polacek <polacek@redhat.com> 2016-01-27 Marek Polacek <polacek@redhat.com>
PR c++/69496 PR c++/69496
......
...@@ -3657,13 +3657,13 @@ mangle_decl (const tree decl) ...@@ -3657,13 +3657,13 @@ mangle_decl (const tree decl)
warning_at (DECL_SOURCE_LOCATION (G.entity), OPT_Wabi, warning_at (DECL_SOURCE_LOCATION (G.entity), OPT_Wabi,
"the mangled name of %qD changed between " "the mangled name of %qD changed between "
"-fabi-version=%d (%D) and -fabi-version=%d (%D)", "-fabi-version=%d (%D) and -fabi-version=%d (%D)",
G.entity, warn_abi_version, id2, G.entity, save_ver, id2,
flag_abi_version, id); warn_abi_version, id);
else else
warning_at (DECL_SOURCE_LOCATION (G.entity), OPT_Wabi, warning_at (DECL_SOURCE_LOCATION (G.entity), OPT_Wabi,
"the mangled name of %qD changes between " "the mangled name of %qD changes between "
"-fabi-version=%d (%D) and -fabi-version=%d (%D)", "-fabi-version=%d (%D) and -fabi-version=%d (%D)",
G.entity, flag_abi_version, id, G.entity, save_ver, id,
warn_abi_version, id2); warn_abi_version, id2);
} }
......
2016-01-27 Martin Sebor <msebor@redhat.com>
PR c++/69317
* g++.dg/abi/Wabi-2-2.C: New test.
* g++.dg/abi/Wabi-2-3.C: New test.
* g++.dg/abi/Wabi-3-2.C: New test.
* g++.dg/abi/Wabi-3-3.C: New test.
2016-01-27 Richard Biener <rguenther@suse.de> 2016-01-27 Richard Biener <rguenther@suse.de>
PR tree-optimization/69166 PR tree-optimization/69166
......
// Verify that no diagnostic is issued when the version specified
// via -Wabi= matches the version specified by -fabi-version=.
// { dg-options "-Werror -Wabi=2 -fabi-version=2" }
// { dg-do compile }
// The mangling of templates with a non-type template parameter
// of reference type changed in ABI version 3:
extern int N;
template <int &> struct S { };
// Expect no diagnostic.
void foo (S<N>) { }
// PR c++/69317 - [6 regression] wrong ABI version in -Wabi warnings
// Exercise that the correct ABI versions are referenced in the -Wabi
// diagnostic. See also the equivalent Wabi-3-2.C test.
// { dg-options "-Wabi=2 -fabi-version=3" }
// { dg-do compile }
// The mangling of templates with a non-type template parameter
// of reference type changed in ABI version 3:
extern int N;
template <int &> struct S { };
// Expect the diagnostic to reference the ABI version specified via
// -fabi-version=3 and the ABI version specified via -Wabi=2.
void foo (S<N>) { } // { dg-warning "the mangled name of .void foo\\(S<N>\\). changed between -fabi-version=3 \\(_Z3foo1SILZ1NEE\\) and -fabi-version=2 \\(_Z3foo1SIL_Z1NEE\\)" }
// PR c++/69317 - [6 regression] wrong ABI version in -Wabi warnings
// Exercise that the correct ABI versions are referenced in the -Wabi
// diagnostic. See also the equivalent Wabi-2-3.C test.
// { dg-options "-Wabi=3 -fabi-version=2" }
// { dg-do compile }
// The mangling of templates with a non-type template parameter
// of reference type changed in ABI version 3:
extern int N;
template <int &> struct S { };
// Expect the diagnostic to reference the ABI version specified via
// -fabi-version=2 and the ABI version specified via -Wabi=3.
void foo (S<N>) { } // { dg-warning "the mangled name of .void foo\\(S<N>\\). changed between -fabi-version=2 \\(_Z3foo1SIL_Z1NEE\\) and -fabi-version=3 \\(_Z3foo1SILZ1NEE\\)" }
// Verify that no diagnostic is issued when the version specified
// via -Wabi= matches the version specified by -fabi-version=.
// { dg-options "-Werror -Wabi=3 -fabi-version=3" }
// { dg-do compile }
// The mangling of templates with a non-type template parameter
// of reference type changed in ABI version 3:
extern int N;
template <int &> struct S { };
// Expect no diagnostic.
void foo (S<N>) { }
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