OSDN Git Service

update
[pf3gnuchains/gcc-fork.git] / gcc / testsuite / g++.old-deja / g++.mike / warn5.C
1 // Build don't link:
2 // Special g++ Options: -Wpointer-arith
3
4 double X(const double x) { return x; }
5 double Y() { return 1.0; }
6 double Z() { return 2.0; }
7
8 struct A {
9   void bar() { }
10   void foo() { }
11 };
12
13 typedef void (A::*pmf)();
14
15 static int mememe = &A::foo - &A::bar;  // WARNING - 
16 pmf b = &A::foo-1;      // WARNING - 
17
18 int main() {
19     double y;
20     y=X(Y-Z);   // WARNING - 
21 }