From 210e6bfa19ab68b75992ba5d6ebfb9d377237de3 Mon Sep 17 00:00:00 2001 From: David Majnemer Date: Fri, 13 Dec 2013 00:39:38 +0000 Subject: [PATCH] Revert "[-cxx-abi microsoft] Mangle reference temporaries" This reverts commit r197184. Richard Smith brings up some good points, a proper implementation will require us to mangle unnameable entities compatibly with MSVC. llvm-svn: 197192 --- clang/lib/AST/MicrosoftMangle.cpp | 7 ++++--- clang/test/CodeGenCXX/mangle-ms.cpp | 7 ------- 2 files changed, 4 insertions(+), 10 deletions(-) diff --git a/clang/lib/AST/MicrosoftMangle.cpp b/clang/lib/AST/MicrosoftMangle.cpp index a02571e8a0ab..24eac84cdd21 100644 --- a/clang/lib/AST/MicrosoftMangle.cpp +++ b/clang/lib/AST/MicrosoftMangle.cpp @@ -2040,9 +2040,10 @@ void MicrosoftMangleContextImpl::mangleCXXDtor(const CXXDestructorDecl *D, } void MicrosoftMangleContextImpl::mangleReferenceTemporary(const VarDecl *VD, - raw_ostream &Out) { - MicrosoftCXXNameMangler mangler(*this, Out); - mangler.mangle(VD); + raw_ostream &) { + unsigned DiagID = getDiags().getCustomDiagID(DiagnosticsEngine::Error, + "cannot mangle this reference temporary yet"); + getDiags().Report(VD->getLocation(), DiagID); } void MicrosoftMangleContextImpl::mangleStaticGuardVariable(const VarDecl *VD, diff --git a/clang/test/CodeGenCXX/mangle-ms.cpp b/clang/test/CodeGenCXX/mangle-ms.cpp index 662234f9e6f2..62f98317504f 100644 --- a/clang/test/CodeGenCXX/mangle-ms.cpp +++ b/clang/test/CodeGenCXX/mangle-ms.cpp @@ -445,10 +445,3 @@ decltype(a) fun(decltype(a) x, decltype(a)) { return x; } // CHECK-DAG: ?fun@PR18022@@YA?AU@1@U21@0@Z } - -// Binding to a bit-field that requires a temporary. -struct { int bitfield : 3; } object_with_bitfield = { 3 }; -const int &reference_to_bitfield = object_with_bitfield.bitfield; -// CHECK-DAG: ?object_with_bitfield@@3U@@A -// CHECK-DAG: ?reference_to_bitfield@@3ABHB -// CHECK-DAG: ??__Ereference_to_bitfield@@YAXXZ