2003-12-26 Guilhem Lavaux <guilhem@kaffe.org>
[official-gcc.git] / gcc / testsuite / g++.old-deja / g++.bugs / 900210_03.C
blobeffebf177703767a95cfef9265ac7affd4c69358
1 // { dg-do assemble  }
2 // g++ 1.36.1 bug 900210_03
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.
7 // Cfront 2.0 passes this test.
9 // keywords: void pointers, pointer type conversions, implicit type conversions
11 void* vp;
12 char* cp;
13 int* ip;
14 enum {enum_value_1} * ep;
15 struct { int member; } * sp;
16 void (*fp) (void);
18 void global_function ()
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 "" }  */
27 int main () { return 0; }