From f7d85e9df2cee82f957751659dcc9e202181245b Mon Sep 17 00:00:00 2001 From: rikardfalkeborn Date: Sun, 20 Jan 2019 10:05:09 +0100 Subject: [PATCH] Add regression test for #6904 (#1611) Ticket #6904 was fixed in 34dbc3c00ceac490c54e68e767104c04341e3f58. Add a regression test to make sure it doesn't reappear. --- test/testcondition.cpp | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/test/testcondition.cpp b/test/testcondition.cpp index a63753f8e..cd4c5be88 100644 --- a/test/testcondition.cpp +++ b/test/testcondition.cpp @@ -2831,6 +2831,13 @@ private: "}\n"); ASSERT_EQUALS("[test.cpp:4]: (style) Condition 'activate' is always false\n" "[test.cpp:5]: (style) Condition 'foo' is always false\n", errout.str()); + + // #6904 + check("void f() {\n" + " const int b[2] = { 1,0 };\n" + " if(b[1] == 2) {}\n" + "}\n"); + ASSERT_EQUALS("[test.cpp:3]: (style) Condition 'b[1]==2' is always false\n", errout.str()); } void duplicateCondition() {