diff options
Diffstat (limited to 'gcc/testsuite/g++.old-deja/g++.other/warn5.C')
-rw-r--r-- | gcc/testsuite/g++.old-deja/g++.other/warn5.C | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/gcc/testsuite/g++.old-deja/g++.other/warn5.C b/gcc/testsuite/g++.old-deja/g++.other/warn5.C new file mode 100644 index 000000000..84fa3e426 --- /dev/null +++ b/gcc/testsuite/g++.old-deja/g++.other/warn5.C @@ -0,0 +1,19 @@ +// { dg-do assemble } +// { dg-options "-W " } +// +// Copyright (C) 2000 Free Software Foundation, Inc. +// Contributed by Nathan Sidwell 6 Febs 2001 <nathan@codesourcery.com> + +// Bug 1765. We gave bogus warning on default initializer. + +struct X +{ + int i; +}; + +X *foo () +{ + return new X (); // gets bogus warning +} + +X x = {}; // { dg-warning "" } missing initializer |