From ffa55bbaa0748e0ddee9a6c2c240e1f27b290ddc Mon Sep 17 00:00:00 2001 From: Frank Zingsheim Date: Sat, 26 Apr 2014 11:59:38 +0200 Subject: [PATCH] Fixed #5725 (FP: multicondition Expression is always false because 'else if' in pngwrite.cxx (LibreOffice)) --- lib/tokenlist.cpp | 1 + test/testtokenize.cpp | 1 + 2 files changed, 2 insertions(+) diff --git a/lib/tokenlist.cpp b/lib/tokenlist.cpp index 8ac2aaca9..f100b9a4f 100644 --- a/lib/tokenlist.cpp +++ b/lib/tokenlist.cpp @@ -576,6 +576,7 @@ static void compileParAndBrackets(Token *&tok, std::stack &op, unsigned while (tok) { if (tok->str() == "[") { compileBinOp(tok, compileScope, op, depth); + tok = tok->next(); } else break; } } diff --git a/test/testtokenize.cpp b/test/testtokenize.cpp index dd0596b47..ffa74ecae 100644 --- a/test/testtokenize.cpp +++ b/test/testtokenize.cpp @@ -10341,6 +10341,7 @@ private: " | `-i\n" " `-f\n", testAst("x = ((a[i]).f)();", true)); + ASSERT_EQUALS("ifp*0[1==(", testAst("if((*p)[0]==1)")); // casts ASSERT_EQUALS("a1(2(+=",testAst("a=(t)1+(t)2;"));