aboutsummaryrefslogtreecommitdiff
path: root/lib/AST/MicrosoftMangle.cpp
diff options
context:
space:
mode:
authorTimur Iskhodzhanov <timurrrr@google.com>2012-07-26 10:41:15 +0000
committerTimur Iskhodzhanov <timurrrr@google.com>2012-07-26 10:41:15 +0000
commitdc6dabcabd36d61d1ad7f5069080b2aade79b1f0 (patch)
treeb40a6abb1d8ea868756aa50d22b2cee421a2a929 /lib/AST/MicrosoftMangle.cpp
parent77b1ae5656cc6ca41bf02831b37fae2d9b27c2a4 (diff)
Fix PR13389 (Wrong mangling of return type qualifiers with -cxx-abi microsoft)
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@160780 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/AST/MicrosoftMangle.cpp')
-rw-r--r--lib/AST/MicrosoftMangle.cpp11
1 files changed, 9 insertions, 2 deletions
diff --git a/lib/AST/MicrosoftMangle.cpp b/lib/AST/MicrosoftMangle.cpp
index 467a45ef00..f6a1f7d9d9 100644
--- a/lib/AST/MicrosoftMangle.cpp
+++ b/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<TagType>(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 :).