gcc/testsuite/g++.old-deja/g++.bugs/900404_07.C
raw| 1 | // { dg-do assemble } |
| 2 | // g++ 1.37.1 bug 900404_07 |
| 3 | |
| 4 | // It is illegal to use a cast to attempt to convert an object type |
| 5 | // to a non-scalar type (e.g. an array type). |
| 6 | |
| 7 | // g++ fails to properly flag as errors such illegal uses of array types. |
| 8 | |
| 9 | // keywords: array types, casts, type conversion |
| 10 | |
| 11 | typedef int array_type[10]; |
| 12 | |
| 13 | array_type *ap; |
| 14 | |
| 15 | void foo () |
| 16 | { |
| 17 | int i = *((array_type) *ap); /* { dg-error "13:ISO C\\+\\+ forbids casting to an array type" } missed */ |
| 18 | } |