From: Anders Carlsson Date: Sat, 26 Sep 2009 23:14:39 +0000 (+0000) Subject: Mangle ::std::basic_string as Sb. X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=189d59cfc762d0f683b9253ddec2cf519ec85b65;p=clang Mangle ::std::basic_string as Sb. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@82881 91177308-0d34-0410-b5e6-96231b3b80d8 --- 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; } + + // < ::= 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 struct allocator { allocator(); }; + template 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, typename std::allocator) { } + +namespace std { + template 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, typename std::basic_string) { }