summaryrefslogtreecommitdiff
path: root/gcc/testsuite/g++.old-deja/g++.mike/warn5.C
blob: af94d53b380bbd62b325a5e5d8cf65d71e327fbf (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
// { dg-do assemble  }
// { dg-options "-Wpointer-arith" }

double X(const double x) { return x; }
double Y() { return 1.0; }
double Z() { return 2.0; }

struct A {
  void bar() { }
  void foo() { }
};

typedef void (A::*pmf)();

static int mememe = &A::foo - &A::bar;	// { dg-error "invalid operands" } 
pmf b = &A::foo-1;	// { dg-error "invalid operands" } 

int main() {
    double y;
    y=X(Y-Z);   // { dg-error "pointer to a function" } 
}