summaryrefslogtreecommitdiff
path: root/gcc/testsuite/g++.dg/warn/Wextra-1.C
diff options
context:
space:
mode:
Diffstat (limited to 'gcc/testsuite/g++.dg/warn/Wextra-1.C')
-rw-r--r--gcc/testsuite/g++.dg/warn/Wextra-1.C12
1 files changed, 12 insertions, 0 deletions
diff --git a/gcc/testsuite/g++.dg/warn/Wextra-1.C b/gcc/testsuite/g++.dg/warn/Wextra-1.C
new file mode 100644
index 000000000..c75a6b087
--- /dev/null
+++ b/gcc/testsuite/g++.dg/warn/Wextra-1.C
@@ -0,0 +1,12 @@
+// { dg-options "-Wextra" }
+
+struct T {
+ // If the implicitly-declared default constructor for "T" is
+ // required, an error will be issued because "i" cannot be
+ // initialized. And, this class is not an aggregate, so it cannot
+ // be brace-initialized. Thus, there is no way to create an object
+ // of this class. We issue a warning with -Wextra.
+ const int i; // { dg-warning "const" }
+private:
+ int j;
+};