gcc/testsuite/gcc.dg/Wint-conversion-4.c
raw| 1 | /* { dg-do compile } */ |
| 2 | /* { dg-options "" } */ |
| 3 | |
| 4 | const char * |
| 5 | f1 (int flag) |
| 6 | { |
| 7 | return flag ? "" : 1; /* { dg-error "pointer/integer type mismatch in conditional expression \\\[-Wint-conversion\\\]" } */ |
| 8 | } |
| 9 | |
| 10 | const char * |
| 11 | f2 (int flag) |
| 12 | { |
| 13 | return flag ? 1 : ""; /* { dg-error "pointer/integer type mismatch in conditional expression \\\[-Wint-conversion\\\]" } */ |
| 14 | } |