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.
-/* 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>
id2 = mangle_decl_string (decl);
id2 = targetm.mangle_decl_assembler_name (decl, id2);
}
+ flag_abi_version = save_ver;
if (id2 == id)
/* OK. */;
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 "
// 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\\)" }
// 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\\)" }