diff options
Diffstat (limited to 'gcc/testsuite/g++.dg/warn/Wextra-2.C')
-rw-r--r-- | gcc/testsuite/g++.dg/warn/Wextra-2.C | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/gcc/testsuite/g++.dg/warn/Wextra-2.C b/gcc/testsuite/g++.dg/warn/Wextra-2.C new file mode 100644 index 000000000..5ca41c39d --- /dev/null +++ b/gcc/testsuite/g++.dg/warn/Wextra-2.C @@ -0,0 +1,15 @@ +// { dg-options "-Wextra" } + +struct S { + S(); +}; + +struct T { +private: + int i; +public: + // There should be no warning about this data member because the + // default constructor for "T" will invoke the default constructor + // for "S", even though "S" is "const". + const S s; // { dg-bogus "const" } +}; |