aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--lib/CodeGen/Mangle.cpp6
-rw-r--r--test/CodeGenCXX/mangle-subst-std.cpp11
2 files changed, 16 insertions, 1 deletions
diff --git a/lib/CodeGen/Mangle.cpp b/lib/CodeGen/Mangle.cpp
index 639d719b79..ff2388e798 100644
--- a/lib/CodeGen/Mangle.cpp
+++ b/lib/CodeGen/Mangle.cpp
@@ -1149,6 +1149,12 @@ bool CXXNameMangler::mangleStandardSubstitution(const NamedDecl *ND) {
Out << "Sa";
return true;
}
+
+ // <<substitution> ::= Sb # ::std::basic_string
+ if (TD->getIdentifier()->isStr("basic_string")) {
+ Out << "Sb";
+ return true;
+ }
}
return false;
diff --git a/test/CodeGenCXX/mangle-subst-std.cpp b/test/CodeGenCXX/mangle-subst-std.cpp
index 0fd5eb1c9b..c35804e2d3 100644
--- a/test/CodeGenCXX/mangle-subst-std.cpp
+++ b/test/CodeGenCXX/mangle-subst-std.cpp
@@ -9,10 +9,19 @@ namespace std {
};
namespace std {
- template<typename T> struct allocator { allocator(); };
+ template<typename T> struct allocator { };
}
// FIXME: typename is really not allowed here, but it's kept
// as a workaround for PR5061.
// CHECK: define void @_Z1fSaIcESaIiE
void f(typename std::allocator<char>, typename std::allocator<int>) { }
+
+namespace std {
+ template<typename T> struct basic_string { };
+}
+
+// FIXME: typename is really not allowed here, but it's kept
+// as a workaround for PR5061.
+// CHECK: define void @_Z1fSbIcESbIiE
+void f(typename std::basic_string<char>, typename std::basic_string<int>) { }