Debian Codegraph @

gcc/testsuite/g++.old-deja/g++.bugs/900210_03.C

raw
1 // { dg-do assemble }
2 // g++ 1.36.1 bug 900210_03
3
4 // g++ allows void* type values to be assigned to variables of other
5 // pointer types. According to the C++ Reference Manual, this is illegal.
6
7 // Cfront 2.0 passes this test.
8
9 // keywords: void pointers, pointer type conversions, implicit type conversions
10
11 void* vp;
12 char* cp;
13 int* ip;
14 enum E {enum_value_1} * ep;
15 struct S { int member; } * sp;
16 void (*fp) (void);
17
18 void global_function ()
19 {
20 cp = vp; /* { dg-error "" } */
21 ip = vp; /* { dg-error "" } */
22 ep = vp; /* { dg-error "" } */
23 sp = vp; /* { dg-error "" } */
24 fp = vp; /* { dg-error "" } */
25 }
26
27 int main () { return 0; }