svn merge -r102224:107263 svn+ssh://gcc.gnu.org/svn/gcc/branches/gcc-3_4-branch
[official-gcc.git] / gcc / testsuite / g++.dg / ext / dllimport7.C
blobfa76d3eec8cb58d76f2f50e2570518d8bd48cfa0
1 // { dg-do compile { target i?86-*-cygwin* i?86-*-mingw*} }
3 //  Report errors on definition of dllimport'd static data member . 
6 struct Baz
8   Baz(int a_ =0) : a(a_) {}; 
9   int a;
12 class  __declspec(dllimport) Bar
14   public:
15     enum {one = 1};
16     static const int two = 2;
17     static const int three;
18     static const Baz null_baz;
21 const int Bar::three = 3;       //  { dg-error "definition of static data" }
22 const Baz Bar::null_baz;        //  { dg-error "definition of static data" }
25 int foo()
27   Bar foobar;
28   const int* baz = &Bar::two; 
29   int a = foobar.two;
30   int b = foobar.three;
31   int c = foobar.null_baz.a;
32   return (a + b + c + *baz);