]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
* pt.c (lookup_template_class_1): Copy abi_tag.
authorJason Merrill <jason@redhat.com>
Fri, 8 Aug 2014 18:17:21 +0000 (14:17 -0400)
committerJason Merrill <jason@gcc.gnu.org>
Fri, 8 Aug 2014 18:17:21 +0000 (14:17 -0400)
From-SVN: r213762

gcc/cp/ChangeLog
gcc/cp/pt.c
gcc/testsuite/g++.dg/abi/abi-tag8.C [new file with mode: 0644]

index 7125444f3313696c484027536fdd3e685dc3a235..6d3eda2651ffc4d5e819b8227a366a90042f3eba 100644 (file)
@@ -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
index 30d8950e204eb9aaf05e680cd572cf4ff222bf3b..25921722f3865202d7520b4a2c1b42cc86ad495d 100644 (file)
@@ -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 (file)
index 0000000..0a6eb58
--- /dev/null
@@ -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" }
+};