The implicit bool conversion could happen superisingly, e.g. when
checking if (Loc1 == Loc2), the compiler will convert SymbolLocation to
bool before comparing (because we don't define operator == for SymbolLocation).
Details
Details
Diff Detail
Diff Detail
- Repository
- rCTE Clang Tools Extra
- Build Status
Buildable 20589 Build 20589: arc lint + arc unit
Event Timeline
Comment Actions
Scary....
Definitely LGTM!
clangd/index/Index.h | ||
---|---|---|
45 | Maybe we should go even further and replace this with an isValid method? Conversion ops are confusing. |
clangd/index/Index.h | ||
---|---|---|
45 | I think making the bool operator explicit is sufficient to avoid the scary implicit-conversion problem. |
Maybe we should go even further and replace this with an isValid method? Conversion ops are confusing.