[PATCH] D43576: Solution to fix PR27066 - Redefinition with same mangled name as another definition (dllexport and uuid)
Zahira Ammarguellat via Phabricator via cfe-commits
cfe-commits at lists.llvm.org
Thu Feb 22 12:25:27 PST 2018
zahiraam updated this revision to Diff 135502.
https://reviews.llvm.org/D43576
Files:
test/CodeGenCXX/instantiate-uuid.cpp
test/Sema/member-reference-dll.cpp
Index: test/Sema/member-reference-dll.cpp
===================================================================
--- test/Sema/member-reference-dll.cpp
+++ /dev/null
@@ -1,24 +0,0 @@
-// RUN: %clang_cc1 -triple x86_64-windows-msvc -fsyntax-only -verify -fms-extensions -fms-compatibility %s
-// expected-no-diagnostics
-
-namespace test1 {
-class __declspec(dllimport) Edge;
-
-template <class T>
-class __declspec(dllimport) Range {
- void insert(T *obj) { obj->loc(); }
-};
-
-template void Range<Edge>::insert(Edge *);
-} // namespace test1
-
-namespace test2 {
-class __declspec(dllexport) Edge;
-
-template <class T>
-class __declspec(dllimport) Range {
- void insert(T *obj) { obj->loc(); }
-};
-
-template void Range<Edge>::insert(Edge *);
-} // namespace test2
Index: test/CodeGenCXX/instantiate-uuid.cpp
===================================================================
--- /dev/null
+++ test/CodeGenCXX/instantiate-uuid.cpp
@@ -0,0 +1,29 @@
+// RUN: %clang_cc1 -triple x86_64-pc-windows-msvc -std=c++14 -fms-extensions -fms-compatibility -emit-llvm -o - %s | Filecheck %s
+
+// expected-no-diagnostics
+
+// M32-DAG: $"\01??4?$A@$E?_GUID_ddb47a6a_0f23_11d5_9109_00e0296b75d3@@3U__s_GUID@@B@@QEAAAEAV0 at AEBV0@@Z" = comdat any
+
+typedef struct _GUID {
+ int i;
+} IID;
+template <const IID *piid>
+class A {};
+
+struct
+ __declspec(uuid("{DDB47A6A-0F23-11D5-9109-00E0296B75D3}"))
+ S1 {};
+
+struct
+ __declspec(uuid("{DDB47A6A-0F23-11D5-9109-00E0296B75D3}"))
+ S2 {};
+
+struct __declspec(dllexport)
+ C1 : public A<&__uuidof(S1)> {};
+
+struct __declspec(dllexport)
+ C2 : public A<&__uuidof(S2)> {};
+
+// CHECK-LABEL: define weak_odr dllexport dereferenceable(1) %class.A* @"\01??4?$A@$E?_GUID_ddb47a6a_0f23_11d5_9109_00e0296b75d3@@3U__s_GUID@@B@@QEAAAEAV0 at AEBV0@@Z"
+
+
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D43576.135502.patch
Type: text/x-patch
Size: 1812 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20180222/86892dc3/attachment-0001.bin>
More information about the cfe-commits
mailing list