summaryrefslogtreecommitdiffstats
path: root/clang/test/CodeGenCXX/mangle-ms.cpp
diff options
context:
space:
mode:
authorDavid Majnemer <david.majnemer@gmail.com>2013-11-25 17:50:19 +0000
committerDavid Majnemer <david.majnemer@gmail.com>2013-11-25 17:50:19 +0000
commit956bc117d9a5afcb3adb39ceb84c480ff030c753 (patch)
tree9c147e26fab64d208c00c0cd0e37e94adbcf225d /clang/test/CodeGenCXX/mangle-ms.cpp
parent3fe7186a1b3de7eaea1b1afb1fdaf1cd13edcd56 (diff)
downloadbcm5719-llvm-956bc117d9a5afcb3adb39ceb84c480ff030c753.tar.gz
bcm5719-llvm-956bc117d9a5afcb3adb39ceb84c480ff030c753.zip
[-cxx-abi microsoft] Create backrefs for <unnamed-type-`id'>
It wasn't possible for an anonymous type to show up inside of function arguments. However, decltype (which MSVC added support for in 2010) makes this possible. Further, backrefs to these anonymous types can now be formed. This fixes PR18022. N.B. We do not, and very likely _will not_, support MSVC's bug where subsequent typedefs of anonymous types leak into the linkage name; this is a gross violation of the ABI. A warning should be introduced to inform our users of this particular shortcoming. llvm-svn: 195669
Diffstat (limited to 'clang/test/CodeGenCXX/mangle-ms.cpp')
-rw-r--r--clang/test/CodeGenCXX/mangle-ms.cpp12
1 files changed, 10 insertions, 2 deletions
diff --git a/clang/test/CodeGenCXX/mangle-ms.cpp b/clang/test/CodeGenCXX/mangle-ms.cpp
index 42d574fa53e..68ec2b3baf6 100644
--- a/clang/test/CodeGenCXX/mangle-ms.cpp
+++ b/clang/test/CodeGenCXX/mangle-ms.cpp
@@ -1,5 +1,5 @@
-// RUN: %clang_cc1 -fblocks -emit-llvm %s -o - -cxx-abi microsoft -triple=i386-pc-win32 | FileCheck %s
-// RUN: %clang_cc1 -fblocks -emit-llvm %s -o - -cxx-abi microsoft -triple=x86_64-pc-win32 | FileCheck -check-prefix X64 %s
+// RUN: %clang_cc1 -fblocks -emit-llvm %s -o - -cxx-abi microsoft -triple=i386-pc-win32 -std=c++11 | FileCheck %s
+// RUN: %clang_cc1 -fblocks -emit-llvm %s -o - -cxx-abi microsoft -triple=x86_64-pc-win32 -std=c++11| FileCheck -check-prefix X64 %s
int a;
// CHECK-DAG: @"\01?a@@3HA"
@@ -356,3 +356,11 @@ void TypedefNewDelete::operator delete[](void *) { }
// CHECK-DAG: ??_UTypedefNewDelete@@SAPAXI@Z
// CHECK-DAG: ??3TypedefNewDelete@@SAXPAX@Z
// CHECK-DAG: ??_VTypedefNewDelete@@SAXPAX@Z
+
+namespace PR18022 {
+
+struct { } a;
+decltype(a) fun(decltype(a) x, decltype(a)) { return x; }
+// CHECK-DAG: ?fun@PR18022@@YA?AU<unnamed-type-a>@1@U21@0@Z
+
+}
OpenPOWER on IntegriCloud