FSF GCC merge 02/23/03
[official-gcc.git] / gcc / testsuite / g++.old-deja / g++.bugs / 900211_04.C
blobe2bd8fd3776ebdef9c4a7bf5aa186c4c6d727e72
1 // g++ 1.36.1 bug 900211_04
3 // g++ fails to flag as errors attempts to compare pointer values against
4 // (nonzero) integer values;
6 // Since implicit conversions of pointer to integers (or vise versa) are
7 // illegal, these comparisons are also illegal.
9 // Cfront 2.0 passes this test.
11 // keywords: comparison operators, pointer types, integral types
13 int result;
14 int i;
15 char *p;
17 void function ()
19   result = i == p;      /* ERROR - caught by g++ */
20   result = i != p;      /* ERROR - caught by g++ */
21   result = i >  p;      /* ERROR - missed */
22   result = i <  p;      /* ERROR - missed */
23   result = i >= p;      /* ERROR - missed */
24   result = i <= p;      /* ERROR - missed */
27 int main () { return 0; }