aboutsummaryrefslogtreecommitdiff
path: root/gcc
diff options
context:
space:
mode:
authorJason Merrill <jason@redhat.com>2014-08-08 14:17:21 -0400
committerJason Merrill <jason@gcc.gnu.org>2014-08-08 14:17:21 -0400
commita6b0c7bc4508a17fcd969080b9e721f4dcd5c305 (patch)
tree8286334c70fbce318b195b800978193880e5e1e8 /gcc
parentff09769fac4d76ae93c1ca473d788b9be6809923 (diff)
downloadgcc-a6b0c7bc4508a17fcd969080b9e721f4dcd5c305.zip
gcc-a6b0c7bc4508a17fcd969080b9e721f4dcd5c305.tar.gz
gcc-a6b0c7bc4508a17fcd969080b9e721f4dcd5c305.tar.bz2
* pt.c (lookup_template_class_1): Copy abi_tag.
From-SVN: r213762
Diffstat (limited to 'gcc')
-rw-r--r--gcc/cp/ChangeLog4
-rw-r--r--gcc/cp/pt.c6
-rw-r--r--gcc/testsuite/g++.dg/abi/abi-tag8.C9
3 files changed, 19 insertions, 0 deletions
diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog
index 7125444..6d3eda2 100644
--- a/gcc/cp/ChangeLog
+++ b/gcc/cp/ChangeLog
@@ -1,3 +1,7 @@
+2014-08-08 Jason Merrill <jason@redhat.com>
+
+ * pt.c (lookup_template_class_1): Copy abi_tag.
+
2014-08-08 Kai Tietz <ktietz@redhat.com>
* semantics.c (expand_or_defer_fn_1): Check for keep-inline-dllexport
diff --git a/gcc/cp/pt.c b/gcc/cp/pt.c
index 30d8950..2592172 100644
--- a/gcc/cp/pt.c
+++ b/gcc/cp/pt.c
@@ -7813,6 +7813,12 @@ lookup_template_class_1 (tree d1, tree arglist, tree in_decl, tree context,
}
}
+ if (OVERLOAD_TYPE_P (t)
+ && !DECL_ALIAS_TEMPLATE_P (gen_tmpl))
+ if (tree attributes
+ = lookup_attribute ("abi_tag", TYPE_ATTRIBUTES (template_type)))
+ TYPE_ATTRIBUTES (t) = attributes;
+
/* Let's consider the explicit specialization of a member
of a class template specialization that is implicitly instantiated,
e.g.:
diff --git a/gcc/testsuite/g++.dg/abi/abi-tag8.C b/gcc/testsuite/g++.dg/abi/abi-tag8.C
new file mode 100644
index 0000000..0a6eb58
--- /dev/null
+++ b/gcc/testsuite/g++.dg/abi/abi-tag8.C
@@ -0,0 +1,9 @@
+// { dg-options "-Wabi-tag" }
+
+template<class T>
+struct __attribute ((__abi_tag__("cxx11"))) list // { dg-message "list" }
+{ };
+
+struct X { // { dg-warning "abi tag" }
+ list<int> l; // { dg-message "X::l" }
+};