Debian Codegraph @

gcc/testsuite/g++.old-deja/g++.bugs/900212_02.C

raw
1 // { dg-do assemble }
2 // g++ 1.36.1 bug 900212_02
3
4 // g++ fails to flag as errors attempts to take the difference of two values
5 // of some compatible pointer-to-member type.
6
7 // Cfront 2.0 passes this test.
8
9 // keywords: pointer arithmetic, subtraction, member pointers
10
11 struct struct0 {
12 };
13
14 int struct0::*p0;
15 int struct0::*p1;
16
17 int (struct0::*fp0) ();
18 int (struct0::*fp1) ();
19
20 int result;
21
22 void global_function_0 ()
23 {
24 result = (p0 - p1); // { dg-error "" }
25 result = (fp0 - fp1); // { dg-error "" }
26 }
27
28 int main () { return 0; }