Fix abi-tag17.C.

* pt.c (lookup_template_class_1): Don't share TYPE_ATTRIBUTES
	between template and instantiation.

From-SVN: r233017
This commit is contained in:
Jason Merrill 2016-01-31 06:52:48 -05:00 committed by Jason Merrill
parent 0c221916d6
commit b676a0798f
3 changed files with 15 additions and 5 deletions

View file

@ -1,3 +1,8 @@
2016-01-31 Jason Merrill <jason@redhat.com>
* pt.c (lookup_template_class_1): Don't share TYPE_ATTRIBUTES
between template and instantiation.
2016-01-29 Jakub Jelinek <jakub@redhat.com>
PR debug/66869

View file

@ -8482,11 +8482,7 @@ lookup_template_class_1 (tree d1, tree arglist, tree in_decl, tree context,
tree attributes
= lookup_attribute (tags[ix], TYPE_ATTRIBUTES (template_type));
if (!attributes)
;
else if (!TREE_CHAIN (attributes) && !TYPE_ATTRIBUTES (t))
TYPE_ATTRIBUTES (t) = attributes;
else
if (attributes)
TYPE_ATTRIBUTES (t)
= tree_cons (TREE_PURPOSE (attributes),
TREE_VALUE (attributes),

View file

@ -0,0 +1,9 @@
// { dg-final { scan-assembler "_Z3fi1B6_X_tagv" } }
struct __attribute((abi_tag("_A1_tag"))) A1 {};
template <class T> struct __attribute((abi_tag("_X_tag"))) X {};
X<int> fi1();
int main() {
X<A1> xa;
fi1();
}