commit 9a8efcc0e2068abb51aaf513b4a7ed262454cd1e
Author: Jonathan Wakely <jwakely@redhat.com>
Date: Fri Nov 14 11:00:24 2014 +0000
gcc/cp:
* mangle.c (find_substitution): Look for abi_tag on class templates.
gcc/testsuite:
* g++.dg/abi/abi-tag11.C: New.
@@ -609,7 +609,7 @@ find_substitution (tree node)
}
tree tags = NULL_TREE;
- if (OVERLOAD_TYPE_P (node))
+ if (OVERLOAD_TYPE_P (node) || DECL_CLASS_TEMPLATE_P (node))
tags = lookup_attribute ("abi_tag", TYPE_ATTRIBUTES (type));
/* Now check the list of available substitutions for this mangling
operation. */
new file mode 100644
@@ -0,0 +1,12 @@
+// { dg-final { scan-assembler "_Z1fSbB3fooIwSt11char_traitsIwESaIwEES3_" } }
+
+namespace std {
+ template <class T> struct char_traits {};
+ template <class T> struct allocator {};
+ template <class T, class U, class V>
+ struct __attribute ((abi_tag ("foo"))) basic_string { };
+ typedef basic_string<wchar_t,char_traits<wchar_t>,allocator<wchar_t> >
+ wstring;
+}
+
+void f(std::wstring,std::wstring) {}