From 0dc47aa30a1e9e13e4fb780b6ecee0b51867f0a4 Mon Sep 17 00:00:00 2001 From: Paolo Carlini Date: Tue, 24 Mar 2015 15:58:05 +0000 Subject: [PATCH] re PR c++/61971 (array subscript is above array bounds [-Werror=array-bounds]) 2015-03-24 Paolo Carlini PR c++/61971 * g++.dg/warn/Warray-bounds-7.C: New. From-SVN: r221636 --- gcc/testsuite/ChangeLog | 5 +++++ gcc/testsuite/g++.dg/warn/Warray-bounds-7.C | 21 +++++++++++++++++++++ 2 files changed, 26 insertions(+) create mode 100644 gcc/testsuite/g++.dg/warn/Warray-bounds-7.C diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index 48a99cc6abe..4a29edfa231 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,8 @@ +2015-03-24 Paolo Carlini + + PR c++/61971 + * g++.dg/warn/Warray-bounds-7.C: New. + 2015-03-24 Paolo Carlini 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 index 00000000000..7f18a61a47a --- /dev/null +++ b/gcc/testsuite/g++.dg/warn/Warray-bounds-7.C @@ -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; +} -- 2.30.2