]> granicus.if.org Git - clang/commitdiff
Revert "[-cxx-abi microsoft] Mangle reference temporaries"
authorDavid Majnemer <david.majnemer@gmail.com>
Fri, 13 Dec 2013 00:39:38 +0000 (00:39 +0000)
committerDavid Majnemer <david.majnemer@gmail.com>
Fri, 13 Dec 2013 00:39:38 +0000 (00:39 +0000)
This reverts commit r197184.

Richard Smith brings up some good points, a proper implementation will
require us to mangle unnameable entities compatibly with MSVC.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@197192 91177308-0d34-0410-b5e6-96231b3b80d8

lib/AST/MicrosoftMangle.cpp
test/CodeGenCXX/mangle-ms.cpp

index a02571e8a0abfd45f6419a41a66b86d7b9445522..24eac84cdd214bc928a450ee4af730ab9fdfb716 100644 (file)
@@ -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,
index 662234f9e6f209801b3f37651958233790ce5166..62f98317504f895c9678d0b12a36344033bcad8f 100644 (file)
@@ -445,10 +445,3 @@ decltype(a) fun(decltype(a) x, decltype(a)) { return x; }
 // CHECK-DAG: ?fun@PR18022@@YA?AU<unnamed-type-a>@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<unnamed-type-object_with_bitfield>@@A
-// CHECK-DAG: ?reference_to_bitfield@@3ABHB
-// CHECK-DAG: ??__Ereference_to_bitfield@@YAXXZ