It seems that the detection of S1117 “declaration shadows a local variable” gets fooled when using the not operator. I guess that it thinks that “not” is a type name and that the boolean expression is a variable declaration. That’s a wild guess and my diagnostic may well be off track.
Here is a simple code that should reproduce the error:
static int sender(int argc, char** argv) {
std::vector<simgrid::s4u::CommPtr> pending_comms;
while(not pending_comms->empty()) { } // I guess that this triggers S1117 even if there is no declaration here
}
yes, you are right, we are not configuring correctly the analyzer in case of operator names, we already have a ticket for it, it is going to fix your false positives.
Is it possible to configure the analyze on our side? We are never using MSVC, but only GCC and clang (plus ICC but we don’t launch the analysis with ICC).
Hi @mquinson the ticket scope is to properly configure operator names for all supported compilers which include GCC and Clang as well which means you will be fine.