diff options
Diffstat (limited to 'gcc-4.8/gcc/testsuite/g++.old-deja/g++.bugs/900210_06.C')
-rw-r--r-- | gcc-4.8/gcc/testsuite/g++.old-deja/g++.bugs/900210_06.C | 26 |
1 files changed, 26 insertions, 0 deletions
diff --git a/gcc-4.8/gcc/testsuite/g++.old-deja/g++.bugs/900210_06.C b/gcc-4.8/gcc/testsuite/g++.old-deja/g++.bugs/900210_06.C new file mode 100644 index 000000000..0475a82c9 --- /dev/null +++ b/gcc-4.8/gcc/testsuite/g++.old-deja/g++.bugs/900210_06.C @@ -0,0 +1,26 @@ +// { dg-do assemble } +// g++ 1.36.1 bug 900210_06 + +// g++ allows values of pointer-to-const types to be assigned to variables +// of pointer-to-non-const types. + +// Cfront 2.0 disallows such assignments. + +// g++ also allows values of pointer-to-volatile types to be assigned to +// variables of pointer-to-non-volatile types. + +// Cfront 2.0 *would* disallow this (if it only supported "volatile"). + +// keywords: pointer types, implicit type conversions + +const char *ccp; +volatile char *vcp; +char *cp; + +void function () +{ + cp = ccp; /* { dg-error "" } */ + cp = vcp; /* { dg-error "" } */ +} + +int main () { return 0; } |