* class.c (check_abi_tags): Don't duplicate tags for conversion ops.
From-SVN: r239299
2016-08-09 Jason Merrill <jason@redhat.com>
+ PR c++/71712
+ * class.c (check_abi_tags): Don't duplicate tags for conversion ops.
+
Adjust mangling of ABI tags on class template member functions.
* class.c (missing_abi_tags): New.
(check_abi_tags): Don't check template. Add just_checking mode.
if (VAR_P (decl))
check_abi_tags (decl, TREE_TYPE (decl));
else if (TREE_CODE (decl) == FUNCTION_DECL
+ && !DECL_CONV_FN_P (decl)
&& !mangle_return_type_p (decl))
check_abi_tags (decl, TREE_TYPE (TREE_TYPE (decl)));
}
if (VAR_P (decl))
return check_abi_tags (decl, TREE_TYPE (decl), true);
else if (TREE_CODE (decl) == FUNCTION_DECL
+ /* Don't check DECL_CONV_FN_P here like we do in check_abi_tags, so
+ that we can use this function for setting need_abi_warning
+ regardless of the current flag_abi_version. */
&& !mangle_return_type_p (decl))
return check_abi_tags (decl, TREE_TYPE (TREE_TYPE (decl)), true);
else
}
tree tags = get_abi_tags (decl);
+ if (TREE_CODE (decl) == FUNCTION_DECL && DECL_CONV_FN_P (decl)
+ && any_abi_below (11))
+ if (tree mtags = missing_abi_tags (decl))
+ {
+ if (abi_warn_or_compat_version_crosses (11))
+ G.need_abi_warning = true;
+ if (!abi_version_at_least (11))
+ tags = chainon (mtags, tags);
+ }
write_abi_tags (tags);
}
--- /dev/null
+// PR c++/71712
+// { dg-options -Wabi=10 }
+
+struct __attribute__((abi_tag("A", "B"))) A { };
+struct A18 {
+ operator A(); // { dg-warning "mangled name" }
+};
+void f18_test() {
+ // { dg-final { scan-assembler "_ZN3A18cv1AB1AB1BEv" } }
+ A a = A18();
+}
--- /dev/null
+// PR c++/71712
+// { dg-options "-fabi-version=10 -Wabi" }
+
+struct __attribute__((abi_tag("A", "B"))) A { };
+struct A18 {
+ operator A(); // { dg-warning "mangled name" }
+};
+void f18_test() {
+ // { dg-final { scan-assembler "_ZN3A18cv1AB1AB1BB1AB1BEv" } }
+ A a = A18();
+}