Commit d676d623 by Jason Merrill Committed by Jason Merrill

PR c++/71712 - ABI tags on conversion ops.

	* class.c (check_abi_tags): Don't duplicate tags for conversion ops.

From-SVN: r239299
parent 7ab8c647
2016-08-09 Jason Merrill <jason@redhat.com> 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. Adjust mangling of ABI tags on class template member functions.
* class.c (missing_abi_tags): New. * class.c (missing_abi_tags): New.
(check_abi_tags): Don't check template. Add just_checking mode. (check_abi_tags): Don't check template. Add just_checking mode.
......
...@@ -1618,6 +1618,7 @@ check_abi_tags (tree decl) ...@@ -1618,6 +1618,7 @@ check_abi_tags (tree decl)
if (VAR_P (decl)) if (VAR_P (decl))
check_abi_tags (decl, TREE_TYPE (decl)); check_abi_tags (decl, TREE_TYPE (decl));
else if (TREE_CODE (decl) == FUNCTION_DECL else if (TREE_CODE (decl) == FUNCTION_DECL
&& !DECL_CONV_FN_P (decl)
&& !mangle_return_type_p (decl)) && !mangle_return_type_p (decl))
check_abi_tags (decl, TREE_TYPE (TREE_TYPE (decl))); check_abi_tags (decl, TREE_TYPE (TREE_TYPE (decl)));
} }
...@@ -1632,6 +1633,9 @@ missing_abi_tags (tree decl) ...@@ -1632,6 +1633,9 @@ missing_abi_tags (tree decl)
if (VAR_P (decl)) if (VAR_P (decl))
return check_abi_tags (decl, TREE_TYPE (decl), true); return check_abi_tags (decl, TREE_TYPE (decl), true);
else if (TREE_CODE (decl) == FUNCTION_DECL 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)) && !mangle_return_type_p (decl))
return check_abi_tags (decl, TREE_TYPE (TREE_TYPE (decl)), true); return check_abi_tags (decl, TREE_TYPE (TREE_TYPE (decl)), true);
else else
......
...@@ -1383,6 +1383,15 @@ write_unqualified_name (tree decl) ...@@ -1383,6 +1383,15 @@ write_unqualified_name (tree decl)
} }
tree tags = get_abi_tags (decl); 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); write_abi_tags (tags);
} }
......
// 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();
}
// 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();
}
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