diff options
author | Jason Merrill <jason@redhat.com> | 2016-08-01 16:19:34 -0400 |
---|---|---|
committer | Jason Merrill <jason@gcc.gnu.org> | 2016-08-01 16:19:34 -0400 |
commit | 352b8babea0ef7d9995f1cb54a482cedca08987f (patch) | |
tree | 12efcd4def72c6c22099fd84360de10722f65537 | |
parent | 92d58deefa851844eddec070d3f944b163d245e6 (diff) | |
download | gcc-352b8babea0ef7d9995f1cb54a482cedca08987f.zip gcc-352b8babea0ef7d9995f1cb54a482cedca08987f.tar.gz gcc-352b8babea0ef7d9995f1cb54a482cedca08987f.tar.bz2 |
* mangle.c (mangle_decl): Fix mangled name change warning.
From-SVN: r238964
-rw-r--r-- | gcc/cp/ChangeLog | 2 | ||||
-rw-r--r-- | gcc/cp/mangle.c | 7 | ||||
-rw-r--r-- | gcc/testsuite/g++.dg/abi/Wabi-2-3.C | 2 | ||||
-rw-r--r-- | gcc/testsuite/g++.dg/abi/Wabi-3-2.C | 2 |
4 files changed, 8 insertions, 5 deletions
diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog index d792baf..2960579 100644 --- a/gcc/cp/ChangeLog +++ b/gcc/cp/ChangeLog @@ -1,5 +1,7 @@ 2016-08-01 Jason Merrill <jason@redhat.com> + * mangle.c (mangle_decl): Fix mangled name change warning. + PR c++/72766 * constexpr.c (cxx_eval_pointer_plus_expression): Check constancy of nelts. diff --git a/gcc/cp/mangle.c b/gcc/cp/mangle.c index d5b26d6..e0bbfc9 100644 --- a/gcc/cp/mangle.c +++ b/gcc/cp/mangle.c @@ -1,4 +1,4 @@ -/* Name mangling for the 3.0 C++ ABI. +/* Name mangling for the 3.0 -*- C++ -*- ABI. Copyright (C) 2000-2016 Free Software Foundation, Inc. Written by Alex Samuel <samuel@codesourcery.com> @@ -3732,6 +3732,7 @@ mangle_decl (const tree decl) id2 = mangle_decl_string (decl); id2 = targetm.mangle_decl_assembler_name (decl, id2); } + flag_abi_version = save_ver; if (id2 == id) /* OK. */; @@ -3740,8 +3741,8 @@ mangle_decl (const tree decl) warning_at (DECL_SOURCE_LOCATION (G.entity), OPT_Wabi, "the mangled name of %qD changed between " "-fabi-version=%d (%D) and -fabi-version=%d (%D)", - G.entity, save_ver, id2, - warn_abi_version, id); + G.entity, warn_abi_version, id2, + save_ver, id); else warning_at (DECL_SOURCE_LOCATION (G.entity), OPT_Wabi, "the mangled name of %qD changes between " diff --git a/gcc/testsuite/g++.dg/abi/Wabi-2-3.C b/gcc/testsuite/g++.dg/abi/Wabi-2-3.C index 5aadf5d..96a0f22 100644 --- a/gcc/testsuite/g++.dg/abi/Wabi-2-3.C +++ b/gcc/testsuite/g++.dg/abi/Wabi-2-3.C @@ -12,5 +12,5 @@ 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\\)" } +void foo (S<N>) { } // { dg-warning "the mangled name of .void foo\\(S<N>\\). changed between -fabi-version=2 \\(_Z3foo1SILZ1NEE\\) and -fabi-version=3 \\(_Z3foo1SIL_Z1NEE\\)" } diff --git a/gcc/testsuite/g++.dg/abi/Wabi-3-2.C b/gcc/testsuite/g++.dg/abi/Wabi-3-2.C index c65e3b6..46bd713 100644 --- a/gcc/testsuite/g++.dg/abi/Wabi-3-2.C +++ b/gcc/testsuite/g++.dg/abi/Wabi-3-2.C @@ -12,5 +12,5 @@ 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\\)" } +void foo (S<N>) { } // { dg-warning "the mangled name of .void foo\\(S<N>\\). changes between -fabi-version=2 \\(_Z3foo1SILZ1NEE\\) and -fabi-version=3 \\(_Z3foo1SIL_Z1NEE\\)" } |