A2-10-1
: False positive around null identifiers on tuple-like types in structural binding (relevant C++17 only)
#581
Labels
C++17
Difficulty-Low
A false positive or false negative report which is expected to take <1 day effort to address
false positive/false negative
An issue related to observed false positives or false negatives.
Impact-Low
Standard-AUTOSAR
wontfix
This will not be worked on
Affected rules
Description
the extractor creates local variables for each identifier, and one for the entire binding. The later is of type tuple without a name, so it gets (null) .
This means if you have another structured binding later on, the rule is falsely triggered because the name is the same.
Example
this example will require additional stubbing to be added to the tuple.h stub, as it currently will not compile due to tuples in that stub not currently having elements. Compilation error message:
error: type 'const std::tuple<int, int>' decomposes into 0 elements, but 2 names were provided
(ie needs to have mechanism to have elements and get those elements)another example is the current finding in openpilot- dmonitoring.cc:82:10 from query
IdentifierHiding.ql
The text was updated successfully, but these errors were encountered: