From 787bc4c384c19d0de18b6c65918dc644fa55d16a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Daniel=20Marjam=C3=A4ki?= Date: Sun, 28 Aug 2011 18:30:58 +0200 Subject: [PATCH] Fixed #3016 (Preprocessor has incorrect precedence(?) for &&) --- lib/tokenize.cpp | 1 + test/testpreprocessor.cpp | 3 ++- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/lib/tokenize.cpp b/lib/tokenize.cpp index ac977c288..4c5d5e566 100644 --- a/lib/tokenize.cpp +++ b/lib/tokenize.cpp @@ -7765,6 +7765,7 @@ bool Tokenizer::simplifyCalculations() tok->str(result); tok->deleteNext(); tok->deleteNext(); + ret = true; } } diff --git a/test/testpreprocessor.cpp b/test/testpreprocessor.cpp index 790d0d97b..72af1a9fc 100644 --- a/test/testpreprocessor.cpp +++ b/test/testpreprocessor.cpp @@ -1050,7 +1050,8 @@ private: ASSERT_EQUALS(true, Preprocessor::match_cfg_def(cfg, "A<2")); ASSERT_EQUALS(false, Preprocessor::match_cfg_def(cfg, "A==2")); ASSERT_EQUALS(false, Preprocessor::match_cfg_def(cfg, "A<1")); - TODO_ASSERT_EQUALS(true, false, Preprocessor::match_cfg_def(cfg, "A>=1&&B<=A")); + ASSERT_EQUALS(false, Preprocessor::match_cfg_def(cfg, "A>=1&&B<=A")); + ASSERT_EQUALS(true, Preprocessor::match_cfg_def(cfg, "A==1 && A==1")); } }