re PR c++/61971 (array subscript is above array bounds [-Werror=array-bounds])
authorPaolo Carlini <paolo.carlini@oracle.com>
Tue, 24 Mar 2015 15:58:05 +0000 (15:58 +0000)
committerPaolo Carlini <paolo@gcc.gnu.org>
Tue, 24 Mar 2015 15:58:05 +0000 (15:58 +0000)
2015-03-24  Paolo Carlini  <paolo.carlini@oracle.com>

PR c++/61971
* g++.dg/warn/Warray-bounds-7.C: New.

From-SVN: r221636

gcc/testsuite/ChangeLog
gcc/testsuite/g++.dg/warn/Warray-bounds-7.C [new file with mode: 0644]

index 48a99cc6abe357acf2f2cf19230a87a8f69c74bd..4a29edfa23180548e3f8e58c877bcfbcc83eacfc 100644 (file)
@@ -1,3 +1,8 @@
+2015-03-24  Paolo Carlini  <paolo.carlini@oracle.com>
+
+       PR c++/61971
+       * g++.dg/warn/Warray-bounds-7.C: New.
+
 2015-03-24  Paolo Carlini  <paolo.carlini@oracle.com>
 
        PR c++/60067
diff --git a/gcc/testsuite/g++.dg/warn/Warray-bounds-7.C b/gcc/testsuite/g++.dg/warn/Warray-bounds-7.C
new file mode 100644 (file)
index 0000000..7f18a61
--- /dev/null
@@ -0,0 +1,21 @@
+// PR c++/61971
+// { dg-options "-O2 -Warray-bounds" }
+
+class B {
+public:
+    virtual ~B(){};
+};
+
+class A {
+public:
+    B   m1[1];
+    B   m2[1];
+    B   m3[1];
+
+    A(){};
+};
+
+int main() {
+        A v;
+        return 0;
+}