diff options
-rw-r--r-- | lib/CodeGen/Mangle.cpp | 2 | ||||
-rw-r--r-- | test/CodeGenCXX/mangle-subst.cpp | 5 |
2 files changed, 6 insertions, 1 deletions
diff --git a/lib/CodeGen/Mangle.cpp b/lib/CodeGen/Mangle.cpp index fd772748db..344ef06276 100644 --- a/lib/CodeGen/Mangle.cpp +++ b/lib/CodeGen/Mangle.cpp @@ -705,7 +705,7 @@ void CXXNameMangler::mangleType(QualType T) { // Only operate on the canonical type! T = Context.getASTContext().getCanonicalType(T); - bool IsSubstitutable = !isa<BuiltinType>(T); + bool IsSubstitutable = T.hasQualifiers() || !isa<BuiltinType>(T); if (IsSubstitutable && mangleSubstitution(T)) return; diff --git a/test/CodeGenCXX/mangle-subst.cpp b/test/CodeGenCXX/mangle-subst.cpp index c53a6300aa..46a21b62b5 100644 --- a/test/CodeGenCXX/mangle-subst.cpp +++ b/test/CodeGenCXX/mangle-subst.cpp @@ -54,3 +54,8 @@ template<typename T> void ft3(S1<T>, S1<char>) { } // CHECK: @_ZN2NS3ft3IiEEvNS_2S1IT_EENS1_IcEE template void ft3<int>(S1<int>, S1<char>); } + +// PR5196 +// CHECK: @_Z1fPKcS0_ +void f(const char*, const char*) {} + |