PR tree-optimization/81303
[official-gcc.git] / gcc / testsuite / obj-c++.dg / warn5.mm
blob5f9b7a7f76d15b322edc4ba0633541b572361ffb
1 /* Check to make sure that a c++ program compiled in objective-c++ mode
2    has no trace of meta-data specific diagnosis coming out of compiling it.
3    This is replicate of warn5.C.
4 */
5 // { dg-do assemble  }
6 // { dg-options "-Wpointer-arith" }
8 double X(const double x) { return x; }
9 double Y() { return 1.0; }
10 double Z() { return 2.0; }
12 struct A {
13   void bar() { }
14   void foo() { }
17 typedef void (A::*pmf)();
19 static int mememe = &A::foo - &A::bar;  // { dg-error "" } 
20 pmf b = &A::foo-1;      // { dg-error "" } 
22 int main() {
23     double y;
24     y=X(Y-Z);   // { dg-error "" }