aboutsummaryrefslogtreecommitdiff
path: root/lib/AST/MicrosoftMangle.cpp
diff options
context:
space:
mode:
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 :).