Remove old autovect-branch by moving to "dead" directory.
[official-gcc.git] / old-autovect-branch / gcc / testsuite / g++.old-deja / g++.jason / net2.C
blobffb52d2b7f3841e31d813c75ef807ec1459ac196
1 // { dg-do run  }
2 // Test of various ?: problems.
4 class D
6 public:
7   void a();
8   void b();
9   D(int i):x(i) {}
10 private:
11   int x;
14 void D::a() {++x;}
15 void D::b() {--x;}
17   
18 int aa=1, bb=0;
20 int fa() {return 0;}
21 int fb() {return 2;}
23 int main(int argc, char* argv[])
25   typedef int* pi;
26   int* p = (argc == 1)? &aa: &bb;
27   *p = 0;
29   typedef int (*ifptr)();
30   ifptr fp = (argc == 1)? fa: fb;
31   aa = fp();
32   
33   D d(0);
34   typedef void (D::*dmem)();
35   dmem mfp = (argc == 1)? &D::a: &D::b;
36   (d.*mfp)();
37   return 0;