================
@@ -338,8 +338,9 @@ auto isValueOrNotEqX() {
}
auto isZeroParamConstMemberCall() {
- return cxxMemberCallExpr(
- callee(cxxMethodDecl(parameterCountIs(0), isConst())));
+ return cxxMemberCallExpr(callee(cxxMethodDecl(
+ parameterCountIs(0), isConst(),
+ unless(hasAnyName("value", "has_value", "hasValue", "operator bool")))));
----------------
BaLiKfromUA wrote:
Thanks for your investigation and experiments!
Haven't we discussed that this solution is rather a hack and the root cause
might be different?
Some suggestions if we go this way:
1. Should we extend the list with more method names, e.g. `isNull` from
`BloombergLP::bdlb::NullableValue`?
2. Can we add a test to double-check that by doing it we don't introduce false
negative? E.g.
```cpp
for (const auto &opt : optionals) {
for (int i = 0; i < 10; ++i) {
opt.value(); // expected error because we don't check
}
}
```
https://github.com/llvm/llvm-project/pull/177858
_______________________________________________
cfe-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits