Debian Codegraph @

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

raw
1 // { dg-do assemble }
2 // g++ 1.36.1 bug 900210_06
3
4 // g++ allows values of pointer-to-const types to be assigned to variables
5 // of pointer-to-non-const types.
6
7 // Cfront 2.0 disallows such assignments.
8
9 // g++ also allows values of pointer-to-volatile types to be assigned to
10 // variables of pointer-to-non-volatile types.
11
12 // Cfront 2.0 *would* disallow this (if it only supported "volatile").
13
14 // keywords: pointer types, implicit type conversions
15
16 const char *ccp;
17 volatile char *vcp;
18 char *cp;
19
20 void function ()
21 {
22 cp = ccp; /* { dg-error "" } */
23 cp = vcp; /* { dg-error "" } */
24 }
25
26 int main () { return 0; }