From: Anders Carlsson Date: Fri, 16 Oct 2009 02:06:06 +0000 (+0000) Subject: Builtin types are subsitutable if they are qualified. Fixes PR5196. X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=410f7640cfa7483132b1524138b1333b9fb9ab33;p=clang Builtin types are subsitutable if they are qualified. Fixes PR5196. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@84237 91177308-0d34-0410-b5e6-96231b3b80d8 --- 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(T); + bool IsSubstitutable = T.hasQualifiers() || !isa(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 void ft3(S1, S1) { } // CHECK: @_ZN2NS3ft3IiEEvNS_2S1IT_EENS1_IcEE template void ft3(S1, S1); } + +// PR5196 +// CHECK: @_Z1fPKcS0_ +void f(const char*, const char*) {} +