* class.c (check_abi_tags): Fix function template handling.

From-SVN: r234790
This commit is contained in:
Jason Merrill 2016-04-06 12:22:45 -04:00 committed by Jason Merrill
parent 41414a0258
commit 469abfd2ef
3 changed files with 17 additions and 0 deletions

View file

@ -1,3 +1,7 @@
2016-04-06 Jason Merrill <jason@redhat.com>
* class.c (check_abi_tags): Fix function template handling.
2016-04-05 Nathan Sidwell <nathan@acm.org>
PR c++/70512

View file

@ -1604,6 +1604,15 @@ check_abi_tags (tree t, tree subob)
void
check_abi_tags (tree decl)
{
tree t;
if (abi_version_at_least (10)
&& DECL_LANG_SPECIFIC (decl)
&& DECL_USE_TEMPLATE (decl)
&& (t = DECL_TEMPLATE_RESULT (DECL_TI_TEMPLATE (decl)),
t != decl))
/* Make sure that our template has the appropriate tags, since
write_unqualified_name looks for them there. */
check_abi_tags (t);
if (VAR_P (decl))
check_abi_tags (decl, TREE_TYPE (decl));
else if (TREE_CODE (decl) == FUNCTION_DECL

View file

@ -0,0 +1,4 @@
struct __attribute__((abi_tag("a"))) X { };
template<typename T> struct Y { X f() { return X(); } };
template struct Y<int>;
// { dg-final { scan-assembler "_ZN1YIiE1fB1aEv" } }