A4-7-1
: Guard using "." operator getting ignored
#600
Labels
Difficulty-High
A false positive or false negative report which is expected to take 1+ week effort to address
false positive/false negative
An issue related to observed false positives or false negatives.
Impact-Medium
Standard-AUTOSAR
user-report
Issue reported by an end user of CodeQL Coding Standards
Affected rules
Description
Changing a class/struct's member value with an arithmetic expression triggers a A4-7-1 warning, despite using an appropriate type guard (example function
false_positive
).I have to workaround it by destructuring my member (example function
true_negative
).It seems that the "." operator is badly supported.
Triggered warning is
cpp/autosar/integer-expression-lead-to-data-loss
.Example
The text was updated successfully, but these errors were encountered: