gcc/testsuite/g++.old-deja/g++.rfg/00321_01-.C
raw| 1 | // { dg-do assemble } |
| 2 | // Here is a simple one. GCC correctly gives errors for this code when the |
| 3 | // - -pedantic-errors option is used, whereas g++ doesn't. |
| 4 | |
| 5 | |
| 6 | int (*p1)[3]; |
| 7 | int (*p2)[5]; |
| 8 | |
| 9 | void |
| 10 | test () |
| 11 | { |
| 12 | p1 == p2; // { dg-error "6:comparison between distinct pointer types" } comparison.* |
| 13 | p1 > p2; // { dg-error "6:comparison between distinct pointer types" } comparison.* |
| 14 | } |