Do not warn for redundant conditional expressions
when the true and false branches are expanded from
different macros even when they are
defined by one another.
We used to get a false warning in the following case:
#define M1 1
#define M2 M1
int test(int cond) {
return cond ? M1 : M2; // false warning: 'true' and 'false' expressions are equivalent
}The problem was that the Lexer::getImmediateMacroName() call was used for comparing macros, which returned "M1" for the expansion of M1 and M2.
Now we are comparing macros from token to token.