diff options
author | David Majnemer <david.majnemer@gmail.com> | 2014-01-21 20:33:36 +0000 |
---|---|---|
committer | David Majnemer <david.majnemer@gmail.com> | 2014-01-21 20:33:36 +0000 |
commit | b9a5f2d3b6333353b4d22e133a342a0dfa10c57f (patch) | |
tree | 4f8a80a3073c62503b77cbbf480b9b05854a0dc8 /clang/lib/AST/MicrosoftMangle.cpp | |
parent | 3e4a34c8c30430a46da69acca1efbf73a2350f23 (diff) | |
download | bcm5719-llvm-b9a5f2d3b6333353b4d22e133a342a0dfa10c57f.tar.gz bcm5719-llvm-b9a5f2d3b6333353b4d22e133a342a0dfa10c57f.zip |
MSVC ABI: Support C++11's auto on variables
The MSVC C++ ABI always uses the deduced type in place of auto when
generating external names for variables.
N.B. MSVC doesn't support C++1y's 'operator auto' and this patch will
not give us said functionality.
llvm-svn: 199764
Diffstat (limited to 'clang/lib/AST/MicrosoftMangle.cpp')
-rw-r--r-- | clang/lib/AST/MicrosoftMangle.cpp | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/clang/lib/AST/MicrosoftMangle.cpp b/clang/lib/AST/MicrosoftMangle.cpp index 30c53ed0ef1..ece12049e7a 100644 --- a/clang/lib/AST/MicrosoftMangle.cpp +++ b/clang/lib/AST/MicrosoftMangle.cpp @@ -345,7 +345,7 @@ void MicrosoftCXXNameMangler::mangleVariableEncoding(const VarDecl *VD) { // Pointers and references are odd. The type of 'int * const foo;' gets // mangled as 'QAHA' instead of 'PAHB', for example. TypeLoc TL = VD->getTypeSourceInfo()->getTypeLoc(); - QualType Ty = TL.getType(); + QualType Ty = VD->getType(); if (Ty->isPointerType() || Ty->isReferenceType() || Ty->isMemberPointerType()) { mangleType(Ty, TL.getSourceRange(), QMM_Drop); @@ -1803,6 +1803,8 @@ void MicrosoftCXXNameMangler::mangleType(const UnaryTransformType *T, } void MicrosoftCXXNameMangler::mangleType(const AutoType *T, SourceRange Range) { + assert(T->getDeducedType().isNull() && "expecting a dependent type!"); + DiagnosticsEngine &Diags = Context.getDiags(); unsigned DiagID = Diags.getCustomDiagID(DiagnosticsEngine::Error, "cannot mangle this 'auto' type yet"); |