From: jason Date: Wed, 6 Apr 2016 16:22:45 +0000 (+0000) Subject: * class.c (check_abi_tags): Fix function template handling. X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=a6f641b5a942b679b84a661c48a359adc1fcc0be;p=thirdparty%2Fgcc.git * class.c (check_abi_tags): Fix function template handling. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@234790 138bc75d-0d04-0410-961f-82ee72b054a4 --- diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog index 3831b92d5642..2cf989ba825d 100644 --- a/gcc/cp/ChangeLog +++ b/gcc/cp/ChangeLog @@ -1,3 +1,7 @@ +2016-04-06 Jason Merrill + + * class.c (check_abi_tags): Fix function template handling. + 2016-04-05 Nathan Sidwell PR c++/70512 diff --git a/gcc/cp/class.c b/gcc/cp/class.c index ade200116503..e66f0b9c51e9 100644 --- a/gcc/cp/class.c +++ b/gcc/cp/class.c @@ -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 diff --git a/gcc/testsuite/g++.dg/abi/abi-tag19.C b/gcc/testsuite/g++.dg/abi/abi-tag19.C new file mode 100644 index 000000000000..e21d7b1256d4 --- /dev/null +++ b/gcc/testsuite/g++.dg/abi/abi-tag19.C @@ -0,0 +1,4 @@ +struct __attribute__((abi_tag("a"))) X { }; +template struct Y { X f() { return X(); } }; +template struct Y; +// { dg-final { scan-assembler "_ZN1YIiE1fB1aEv" } }