diff options
Diffstat (limited to 'gcc/testsuite/g++.dg/init/pr25811-2.C')
-rw-r--r-- | gcc/testsuite/g++.dg/init/pr25811-2.C | 26 |
1 files changed, 26 insertions, 0 deletions
diff --git a/gcc/testsuite/g++.dg/init/pr25811-2.C b/gcc/testsuite/g++.dg/init/pr25811-2.C new file mode 100644 index 000000000..3a36dd49c --- /dev/null +++ b/gcc/testsuite/g++.dg/init/pr25811-2.C @@ -0,0 +1,26 @@ +// { dg-do compile } +// { dg-options -fpermissive } + +struct A +{ + int const i; // { dg-message "should be initialized" } +}; + +struct B +{ + int& r; // { dg-message "should be initialized" } +}; + +struct C +{ + int const i : 1; // { dg-message "should be initialized" } +}; + +void f() +{ + new A; // { dg-warning "uninitialized" } + new B; // { dg-warning "uninitialized" } + new C; // { dg-warning "uninitialized" } + C c; // { dg-warning "uninitialized" } + A a[1]; // { dg-warning "uninitialized" } +} |