mirror of
https://github.com/llvm/llvm-project.git
synced 2025-04-25 12:16:08 +00:00

This fixes building Qt as shared libraries with clang in MinGW mode; previously subclasses of the QObjectData class (in other DLLs than the base DLL) failed to find the typeinfo symbols (that neither were emitted in the base DLL nor in the DLL containing the subclass). If the virtual destructor in the newly added testcase wouldn't be pure (or if there'd be another non-pure virtual method), it'd be a key function and things would work out even before this change. Make sure to locally emit the typeinfo for these classes as well. This matches what GCC does in this specific testcase. This fixes the root issue that spawned PR35146. (The difference to GCC that is initially described in that bug still is present though.) Differential Revision: https://reviews.llvm.org/D42641 llvm-svn: 324059
21 lines
493 B
C++
21 lines
493 B
C++
// RUN: %clang_cc1 -triple i686-windows-gnu -emit-llvm -std=c++1y -O0 -o - %s -w | FileCheck --check-prefix=GNU %s
|
|
|
|
class __declspec(dllimport) QObjectData {
|
|
public:
|
|
virtual ~QObjectData() = 0;
|
|
void *ptr;
|
|
|
|
int method() const;
|
|
};
|
|
|
|
class LocalClass : public QObjectData {
|
|
};
|
|
|
|
void call() {
|
|
(new LocalClass())->method();
|
|
}
|
|
|
|
// GNU-DAG: @_ZTV11QObjectData = available_externally dllimport
|
|
// GNU-DAG: @_ZTS11QObjectData = linkonce_odr
|
|
// GNU-DAG: @_ZTI11QObjectData = linkonce_odr
|