Home | History | Annotate | Download | only in stress1
      1 #ifndef STRESS1_COMMON_H
      2 #define STRESS1_COMMON_H
      3 
      4 inline char function00(char x) { return x + x; }
      5 inline short function00(short x) { return x + x; }
      6 inline int function00(int x) { return x + x; }
      7 
      8 namespace N01 { struct S00; }
      9 
     10 namespace N00 {
     11 struct S00 {
     12   char c;
     13   short s;
     14   int i;
     15 
     16   S00(char x) : c(x) {}
     17   S00(short x) : s(x) {}
     18   S00(int x) : i(x) {}
     19 
     20   char method00(char x) { return x + x; }
     21   short method00(short x) { return x + x; }
     22   int method00(int x) { return x + x; }
     23 
     24   operator char() { return c; }
     25   operator short() { return s; }
     26   operator int() { return i; }
     27 };
     28 struct S01 {};
     29 struct S02 {};
     30 template <typename T> struct S03 {
     31   struct S00 : N00::S00 {};
     32 };
     33 template <int I, template <typename> class U> struct S03<U<int>[I]>
     34     : U<int>::S00 {
     35   S03();
     36   S03(int);
     37   S03(short);
     38   S03(char);
     39   template <typename V = decltype(I)> S03(V);
     40 };
     41 template <> struct S03<S03<int>[42]> : S00 {};
     42 }
     43 
     44 namespace N01 {
     45 struct S00 : N00::S00 {
     46   using N00::S00::S00;
     47 };
     48 struct S01 {};
     49 struct S02 {};
     50 }
     51 
     52 using namespace N00;
     53 
     54 template <int I, template <typename> class U> template <typename V> S03<U<int>[I]>::S03(V x) : S00(x) {}
     55 template <int I, template <typename> class U> S03<U<int>[I]>::S03() : S00(I) {}
     56 template <int I, template <typename> class U> S03<U<int>[I]>::S03(char x) : S00(x) {}
     57 template <int I, template <typename> class U> S03<U<int>[I]>::S03(short x) : S00(x) {}
     58 template <int I, template <typename> class U> S03<U<int>[I]>::S03(int x) : S00(x) {}
     59 
     60 #pragma weak pragma_weak00
     61 #pragma weak pragma_weak01
     62 #pragma weak pragma_weak02
     63 #pragma weak pragma_weak03
     64 #pragma weak pragma_weak04
     65 #pragma weak pragma_weak05
     66 
     67 extern "C" int pragma_weak00();
     68 extern "C" int pragma_weak01();
     69 extern "C" int pragma_weak02();
     70 extern "C" int pragma_weak03;
     71 extern "C" int pragma_weak04;
     72 extern "C" int pragma_weak05;
     73 
     74 #endif
     75