summaryrefslogtreecommitdiffstats
path: root/Tests/RunCMake/AutoExportDll
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2023-02-15 13:58:35 (GMT)
committerKitware Robot <kwrobot@kitware.com>2023-02-15 13:58:44 (GMT)
commitb297b63f17e6c4f7c24fa14521519179a18b6e35 (patch)
tree313b4b85a0f54ca69767eaf6391e84efbf5a86f9 /Tests/RunCMake/AutoExportDll
parente2ed34abf899ebe528709c2850503fd7ead544a9 (diff)
parentf513781bc51e99ceb003ac11c93639bb09e05cf4 (diff)
downloadCMake-b297b63f17e6c4f7c24fa14521519179a18b6e35.zip
CMake-b297b63f17e6c4f7c24fa14521519179a18b6e35.tar.gz
CMake-b297b63f17e6c4f7c24fa14521519179a18b6e35.tar.bz2
Merge topic 'AutoExport-vftable'
f513781bc5 WINDOWS_EXPORT_ALL_SYMBOLS: Export vftable symbol Acked-by: Kitware Robot <kwrobot@kitware.com> Acked-by: buildbot <buildbot@kitware.com> Merge-request: !8201
Diffstat (limited to 'Tests/RunCMake/AutoExportDll')
-rw-r--r--Tests/RunCMake/AutoExportDll/hello.cxx9
-rw-r--r--Tests/RunCMake/AutoExportDll/hello.h17
-rw-r--r--Tests/RunCMake/AutoExportDll/say.cxx3
3 files changed, 29 insertions, 0 deletions
diff --git a/Tests/RunCMake/AutoExportDll/hello.cxx b/Tests/RunCMake/AutoExportDll/hello.cxx
index 74e7a4e..35ccbb7 100644
--- a/Tests/RunCMake/AutoExportDll/hello.cxx
+++ b/Tests/RunCMake/AutoExportDll/hello.cxx
@@ -12,3 +12,12 @@ void hello()
}
void Hello::operator delete[](void*){};
void Hello::operator delete(void*){};
+
+#ifdef HELLO_VFTABLE
+HelloVFTable::HelloVFTable()
+{
+}
+HelloVFTable::~HelloVFTable()
+{
+}
+#endif
diff --git a/Tests/RunCMake/AutoExportDll/hello.h b/Tests/RunCMake/AutoExportDll/hello.h
index 7192f65..410ffab 100644
--- a/Tests/RunCMake/AutoExportDll/hello.h
+++ b/Tests/RunCMake/AutoExportDll/hello.h
@@ -16,3 +16,20 @@ public:
static void operator delete[](void*);
static void operator delete(void*);
};
+
+// In the MSVC ABI, a delegating constructor references the vftable.
+#if __cplusplus >= 201103L || (defined(_MSVC_LANG) && _MSVC_LANG >= 201103L)
+# define HELLO_VFTABLE
+#endif
+#ifdef HELLO_VFTABLE
+class HelloVFTable
+{
+public:
+ HelloVFTable();
+ HelloVFTable(int)
+ : HelloVFTable()
+ {
+ }
+ virtual ~HelloVFTable();
+};
+#endif
diff --git a/Tests/RunCMake/AutoExportDll/say.cxx b/Tests/RunCMake/AutoExportDll/say.cxx
index 8fc768a..a9459a9 100644
--- a/Tests/RunCMake/AutoExportDll/say.cxx
+++ b/Tests/RunCMake/AutoExportDll/say.cxx
@@ -53,5 +53,8 @@ int main()
#ifdef HAS_JUSTNOP
justnop();
#endif
+#ifdef HELLO_VFTABLE
+ HelloVFTable helloVFTable(1);
+#endif
return 0;
}