diff options
| author | David Majnemer <david.majnemer@gmail.com> | 2015-12-29 22:25:14 +0000 |
|---|---|---|
| committer | David Majnemer <david.majnemer@gmail.com> | 2015-12-29 22:25:14 +0000 |
| commit | e77de75d7e009daaadb03e9b1091c3a9a9c9d311 (patch) | |
| tree | 5f6c36f86e571a40d01a78cc00a7d693d7eadcb3 /clang/lib | |
| parent | 90bee6354d3e558c485926dba3e2ce2fb7f3585d (diff) | |
| download | bcm5719-llvm-e77de75d7e009daaadb03e9b1091c3a9a9c9d311.tar.gz bcm5719-llvm-e77de75d7e009daaadb03e9b1091c3a9a9c9d311.zip | |
[MS ABI] Invent a mangling for reference temporaries
MSVC is non-conforming and doesn't have a mangling for these. Invent
our own to unblock folks using clang.
This fixes PR25795.
llvm-svn: 256589
Diffstat (limited to 'clang/lib')
| -rw-r--r-- | clang/lib/AST/MicrosoftMangle.cpp | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/clang/lib/AST/MicrosoftMangle.cpp b/clang/lib/AST/MicrosoftMangle.cpp index 3e466c826be..ba8ff270279 100644 --- a/clang/lib/AST/MicrosoftMangle.cpp +++ b/clang/lib/AST/MicrosoftMangle.cpp @@ -2760,12 +2760,12 @@ void MicrosoftMangleContextImpl::mangleCXXDtor(const CXXDestructorDecl *D, mangler.mangle(D); } -void MicrosoftMangleContextImpl::mangleReferenceTemporary(const VarDecl *VD, - unsigned, - raw_ostream &) { - unsigned DiagID = getDiags().getCustomDiagID(DiagnosticsEngine::Error, - "cannot mangle this reference temporary yet"); - getDiags().Report(VD->getLocation(), DiagID); +void MicrosoftMangleContextImpl::mangleReferenceTemporary( + const VarDecl *VD, unsigned ManglingNumber, raw_ostream &Out) { + MicrosoftCXXNameMangler Mangler(*this, Out); + + Mangler.getStream() << "\01?$RT" << ManglingNumber << '@'; + Mangler.mangle(VD, ""); } void MicrosoftMangleContextImpl::mangleThreadSafeStaticGuardVariable( |

