-Wconstant-logical-operand should not fire for expressions involving macros #63963
Labels
clang:diagnostics
New/improved warning or error message in Clang, but not in clang-tidy or static analyzer
quality-of-implementation
Clang currently issues this diagnostic when the constant in question is a macro, as in (live example):
I think any use of a macro should suppress the diagnostic on the assumption that the macro value is constant for one configuration but may not be constant in all configurations. However, I can also see why we might want to still diagnose macro uses, such as cases like:
where the user could have forgotten to add
error ==
to the expression. So it might be that we want to split this off into separate diagnostic groups.Relates to discussion in https://reviews.llvm.org/D142609
The text was updated successfully, but these errors were encountered: