/* Change flag_abi_version to be the actual current ABI level, for the
benefit of c_cpp_builtins, and to make comparison simpler. */
- const int latest_abi_version = 15;
+ const int latest_abi_version = 16;
/* Generate compatibility aliases for ABI v11 (7.1) by default. */
const int abi_compat_default = 11;
; 14: Corrects the mangling of nullptr expression.
; Default in G++ 10.
;
-; 15: Changes the mangling of __alignof__ to be distinct from that of alignof.
+; 15: Corrects G++ 10 ABI tag regression [PR98481].
+; Available, but not default, in G++ 10.3.
+;
+; 16: Changes the mangling of __alignof__ to be distinct from that of alignof.
+; Adds missing 'on' in mangling of operator names in some cases.
; Default in G++ 11.
;
; Additional positive integers will be assigned as new versions of
static tree
find_abi_tags_r (tree *tp, int *walk_subtrees, void *data)
{
- if (TYPE_P (*tp) && *walk_subtrees == 1)
- /* Tell cp_walk_subtrees to look though typedefs. */
+ if (TYPE_P (*tp) && *walk_subtrees == 1 && flag_abi_version != 14)
+ /* Tell cp_walk_subtrees to look though typedefs. [PR98481] */
*walk_subtrees = 2;
if (!OVERLOAD_TYPE_P (*tp))
static tree
mark_abi_tags_r (tree *tp, int *walk_subtrees, void *data)
{
- if (TYPE_P (*tp) && *walk_subtrees == 1)
+ if (TYPE_P (*tp) && *walk_subtrees == 1 && flag_abi_version != 14)
/* Tell cp_walk_subtrees to look though typedefs. */
*walk_subtrees = 2;
{
if (!ALIGNOF_EXPR_STD_P (expr))
{
- if (abi_warn_or_compat_version_crosses (15))
+ if (abi_warn_or_compat_version_crosses (16))
G.need_abi_warning = true;
- if (abi_version_at_least (15))
+ if (abi_version_at_least (16))
{
/* We used to mangle __alignof__ like alignof. */
write_string ("u11__alignof__");
tree name = dependent_name (expr);
if (IDENTIFIER_ANY_OP_P (name))
{
- if (abi_version_at_least (15))
+ if (abi_version_at_least (16))
write_string ("on");
- if (abi_warn_or_compat_version_crosses (15))
+ if (abi_warn_or_compat_version_crosses (16))
G.need_abi_warning = 1;
}
write_unqualified_id (name);
--- /dev/null
+// PR c++/98481
+// { dg-do compile { target c++11 } }
+// { dg-additional-options -fabi-version=14 }
+inline namespace N __attribute ((__abi_tag__ ("myabi")))
+{
+ struct A {};
+}
+template <typename T>
+struct B { typedef int size_type; };
+struct S1 { B<A>::size_type foo () const { return 1; } };
+struct S2 { B<A>::size_type foo () const; };
+int S2::foo () const { return 2; }
+int (S1::*f1) () const = &S1::foo;
+int (S2::*f2) () const = &S2::foo;
+
+// { dg-final { scan-assembler-not "_ZNK2S13fooEv" } }
+// { dg-final { scan-assembler "_ZNK2S23fooEv" } }
+// { dg-final { scan-assembler "_ZNK2S13fooB5myabiEv" } }
// This testcase will need to be kept in sync with c_common_post_options.
// { dg-options "-fabi-version=0" }
-#if __GXX_ABI_VERSION != 1015
+#if __GXX_ABI_VERSION != 1016
#error "Incorrect value of __GXX_ABI_VERSION"
#endif