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
Event Timeline
Comment Actions
Scary....
Definitely LGTM!
clangd/index/Index.h | ||
---|---|---|
45–49 | Maybe we should go even further and replace this with an isValid method? Conversion ops are confusing. |
clangd/index/Index.h | ||
---|---|---|
45–49 | 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.