[PR c++/84702] ICE with default tmpl arg of overload set
[official-gcc.git] / gcc / testsuite / g++.dg / ext / dllimport3.C
blob6538232f7d371f1c493771522c94a6ef95db8b88
1 // { dg-do compile { target i?86-*-cygwin* i?86-*-mingw* x86_64-*-mingw* } }
3 // PR 10148  Dllimport attribute of object is overriden by later
4 // redefinition without attribute.
5  
6 struct Foo
8   int a;
9 };
11  __attribute__((dllimport)) struct Foo f;
13 void Bar(void)
15   void* dummy  = (void*) &f;
18 struct Foo f;   // { dg-warning "referenced with dll linkage" }
20 // Dllimport'd symbols do not have a constant address, so following
21 // assignment would require static_initialization_and_destruction
22 // if attribute is retained. 
24 void* dummy = &f;