diff options
Diffstat (limited to 'gcc/testsuite/g++.dg/warn/Wuninitialized-1.C')
-rw-r--r-- | gcc/testsuite/g++.dg/warn/Wuninitialized-1.C | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/gcc/testsuite/g++.dg/warn/Wuninitialized-1.C b/gcc/testsuite/g++.dg/warn/Wuninitialized-1.C new file mode 100644 index 000000000..7b1b90b94 --- /dev/null +++ b/gcc/testsuite/g++.dg/warn/Wuninitialized-1.C @@ -0,0 +1,15 @@ +/* { dg-options "-O2 -Wuninitialized" } */ + +struct Empty { Empty() {} }; /* { dg-bogus "uninitialized" } */ +struct Other { + Other(const Empty& e_) : e(e_) {} + Empty e; +}; +void bar(Other&); +void foo() +{ + Empty e; + Other o(e); + bar(o); +} + |