From c2e3ba48e315312560a2fb26cbb8e8045ab9991e Mon Sep 17 00:00:00 2001 From: Reid Kleckner Date: Mon, 10 Aug 2015 19:39:01 +0000 Subject: [dllimport] A non-imported class with an imported key can't have a key Summary: The vtable takes its DLL storage class from the class, not the key function. When they disagree, the vtable won't be exported by the DLL that defines the key function. The easiest way to ensure that importers of the class emit their own vtable is to say that the class has no key function. Reviewers: hans, majnemer Subscribers: cfe-commits Differential Revision: http://reviews.llvm.org/D11913 llvm-svn: 244488 --- clang/test/CodeGenCXX/dllimport-rtti.cpp | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'clang/test/CodeGenCXX/dllimport-rtti.cpp') diff --git a/clang/test/CodeGenCXX/dllimport-rtti.cpp b/clang/test/CodeGenCXX/dllimport-rtti.cpp index 609ad1637ca..071ce278a5b 100644 --- a/clang/test/CodeGenCXX/dllimport-rtti.cpp +++ b/clang/test/CodeGenCXX/dllimport-rtti.cpp @@ -22,3 +22,11 @@ struct __declspec(dllimport) V { // GNU-DAG: @_ZTV1V = available_externally dllimport // GNU-DAG: @_ZTS1V = linkonce_odr // GNU-DAG: @_ZTI1V = linkonce_odr + +struct W { + __declspec(dllimport) virtual void f(); + virtual void g(); +} w; +// GNU-DAG: @_ZTV1W = linkonce_odr +// GNU-DAG: @_ZTS1W = linkonce_odr +// GNU-DAG: @_ZTI1W = linkonce_odr -- cgit v1.2.3