2 // g++ 1.36.1 bug 900212_01
4 // g++ fails to flag as errors all attempts to add or subtract integer values
5 // from pointers-to-member values.
7 // Some cases are detected however.
9 // Cfront 2.0 passes this test.
11 // keywords: pointer arithmetic, member pointers
19 int (struct0::*fp0) ();
20 int (struct0::*fp1) ();
22 void global_function_0 ()
24 p0 = p1 + 3; // { dg-error "" }
25 p0 = p1 - 3; // { dg-error "" }
26 p1++; /* { dg-error "" } caught by g++ */
27 ++p1; /* { dg-error "" } caught by g++ */
28 p1--; /* { dg-error "" } caught by g++ */
29 --p1; /* { dg-error "" } caught by g++ */
31 fp0 = fp1 + 3; // { dg-error "" }
32 fp0 = fp1 - 3; // { dg-error "" }
33 fp1++; /* { dg-error "" } */
34 ++fp1; /* { dg-error "" } */
35 fp1--; /* { dg-error "" } */
36 --fp1; /* { dg-error "" } */
39 int main () { return 0; }