diff options
Diffstat (limited to 'gcc/testsuite/gcc.dg/pr22308-1.c')
-rw-r--r-- | gcc/testsuite/gcc.dg/pr22308-1.c | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/gcc/testsuite/gcc.dg/pr22308-1.c b/gcc/testsuite/gcc.dg/pr22308-1.c new file mode 100644 index 000000000..2b3067577 --- /dev/null +++ b/gcc/testsuite/gcc.dg/pr22308-1.c @@ -0,0 +1,13 @@ +/* Bug 22308: C_TYPE_FIELDS_READONLY not updated on type variants. */ +/* { dg-do compile } */ +/* { dg-options "" } */ + +struct foo s; +volatile struct foo t; +struct foo { const int z; }; + +void +bar (void) +{ + t = s; /* { dg-error "assignment of read-only variable 't'" } */ +} |