Debian Codegraph @

gcc/testsuite/g++.dg/ext/dllimport12.C

raw
1 // PR target/27650
2 // Don't use dllimport semantics on virtual methods when initializing
3 // vtables
4 // { dg-do compile { target i?86-*-cygwin* i?86-*-mingw* x86_64-*-mingw* } }
5
6 // Use import lib thunk for vtable entry of explicitly virtual method,
7 struct base
8 {
9 virtual void key_method();
10 __attribute__((dllimport)) virtual ~base();
11 };
12
13 void base::key_method() {}
14
15
16 // Likewise for an implicitly virtual method.
17 struct derived : public base
18 {
19 void key_method();
20 __attribute__((dllimport)) ~derived();
21 };
22
23 void derived::key_method() {}