The matcher is using hasAncestor and could be skipping many different issues, simply because they have an ancestor node (e.g., VarDecl) but that node is not closely related to the construct expression itself.
struct RegularException {
RegularException(int);
};
void foo() {
const auto var = []() {
RegularException{0}; // FN, ignored because of `hasAncestor(varDecl())`
return 0;
};
}
struct Bar {
Bar() : v{0} {
RegularException{0}; // FN, ignored because of `hasAncestor(cxxConstructorDecl())`
}
int v;
};
The matcher is using `hasAncestor` and could be skipping many different issues, simply because they have an ancestor node (e.g., `VarDecl`) but that node is not closely related to the construct expression itself.
```c++
struct RegularException {
RegularException(int);
};
void foo() {
const auto var = []() {
RegularException{0}; // FN, ignored because of `hasAncestor(varDecl())`
return 0;
};
}
struct Bar {
Bar() : v{0} {
RegularException{0}; // FN, ignored because of `hasAncestor(cxxConstructorDecl())`
}
int v;
};
```
https://godbolt.org/z/6br6f91vc
The matcher is using
hasAncestor
and could be skipping many different issues, simply because they have an ancestor node (e.g.,VarDecl
) but that node is not closely related to the construct expression itself.https://godbolt.org/z/6br6f91vc