Fixed #3016 (Preprocessor has incorrect precedence(?) for &&)

This commit is contained in:
Daniel Marjamäki 2011-08-28 18:30:58 +02:00
parent cf6d04de74
commit 787bc4c384
2 changed files with 3 additions and 1 deletions

View File

@ -7765,6 +7765,7 @@ bool Tokenizer::simplifyCalculations()
tok->str(result);
tok->deleteNext();
tok->deleteNext();
ret = true;
}
}

View File

@ -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"));
}
}