summaryrefslogtreecommitdiffstats
path: root/test/CodeGenCXX/mangle-ms-cxx11.cpp
diff options
context:
space:
mode:
authorDavid Majnemer <david.majnemer@gmail.com>2015-08-31 18:48:39 +0000
committerDavid Majnemer <david.majnemer@gmail.com>2015-08-31 18:48:39 +0000
commitd17ec04400eee3fef6d1d6f71fdeceb226a3181d (patch)
treec10e72b33570d1934062acffbe9807b54d7d171e /test/CodeGenCXX/mangle-ms-cxx11.cpp
parentc26554dd3bce88e59f4ad11c9ca0c5ac1c0cf3fd (diff)
[MS ABI] Correctly mangle classes without names for linkage purposes
A class without a name for linkage purposes gets a name along the lines of <unnamed-type-foo> where foo is either the name of a declarator which defined it (like a variable or field) or a typedef-name (like a typedef or alias-declaration). We handled the declarator case correctly but it would fall down during template instantiation if the declarator didn't share the tag's type. We failed to handle the typedef-name case at all. Instead, keep track of the association between the two and keep it up to date in the face of template instantiation. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@246469 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test/CodeGenCXX/mangle-ms-cxx11.cpp')
-rw-r--r--test/CodeGenCXX/mangle-ms-cxx11.cpp18
1 files changed, 18 insertions, 0 deletions
diff --git a/test/CodeGenCXX/mangle-ms-cxx11.cpp b/test/CodeGenCXX/mangle-ms-cxx11.cpp
index 3f4075f7f3..7cb09704de 100644
--- a/test/CodeGenCXX/mangle-ms-cxx11.cpp
+++ b/test/CodeGenCXX/mangle-ms-cxx11.cpp
@@ -243,3 +243,21 @@ void f() {}
template void f<AliasA>();
// CHECK-DAG: @"\01??$f@$$YAliasA@PR20047@@@PR20047@@YAXXZ"
}
+
+namespace UnnamedType {
+struct A {
+ struct {} *TD;
+};
+
+void f(decltype(*A::TD)) {}
+// CHECK-DAG: @"\01?f@UnnamedType@@YAXAAU<unnamed-type-TD>@A@1@@Z"
+
+template <typename T>
+struct B {
+ enum {
+ } *e;
+};
+
+void f(decltype(B<int>::e)) {}
+// CHECK-DAG: @"\01?f@UnnamedType@@YAXPAW4<unnamed-type-e>@?$B@H@1@@Z
+}