From 25fabdbace8b2384fac2a473fd115f005f55a2d3 Mon Sep 17 00:00:00 2001 From: Timur Iskhodzhanov Date: Thu, 26 Jul 2012 10:41:15 +0000 Subject: Fix PR13389 (Wrong mangling of return type qualifiers with -cxx-abi microsoft) llvm-svn: 160780 --- clang/lib/AST/MicrosoftMangle.cpp | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) (limited to 'clang/lib/AST/MicrosoftMangle.cpp') diff --git a/clang/lib/AST/MicrosoftMangle.cpp b/clang/lib/AST/MicrosoftMangle.cpp index 467a45ef00c..f6a1f7d9d92 100644 --- a/clang/lib/AST/MicrosoftMangle.cpp +++ b/clang/lib/AST/MicrosoftMangle.cpp @@ -1090,8 +1090,15 @@ void MicrosoftCXXNameMangler::mangleType(const FunctionType *T, else { QualType Result = Proto->getResultType(); const Type* RT = Result.getTypePtr(); - if(isa(RT) && !RT->isAnyPointerType() && !RT->isReferenceType()) - Out << "?A"; + if (!RT->isAnyPointerType() && !RT->isReferenceType()) { + if (Result.hasQualifiers() || !RT->isBuiltinType()) + Out << '?'; + if (!RT->isBuiltinType() && !Result.hasQualifiers()) { + // Lack of qualifiers for user types is mangled as 'A'. + Out << 'A'; + } + } + // FIXME: Get the source range for the result type. Or, better yet, // implement the unimplemented stuff so we don't need accurate source // location info anymore :). -- cgit v1.2.3