Skip to content

Commit

Permalink
Exclude rvalue references from const in AUTOSAR rule 7-1-1.
Browse files Browse the repository at this point in the history
  • Loading branch information
fjatWbyT committed Dec 10, 2024
1 parent 16bfd28 commit 003feef
Showing 1 changed file with 1 addition and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ where
not exists(LambdaExpression lc | lc.getACapture().getField() = v) and
not v.isFromUninstantiatedTemplate(_) and
not v.isCompilerGenerated() and
not v.getType() instanceof RValueReferenceType and
//if the instantiation is not constexpr but the template is, still exclude it as a candidate
not exists(TemplateVariable b | b.getAnInstantiation() = v and b.isConstexpr())
select v, "Non-constant variable " + v.getName() + cond + " and is not modified."

0 comments on commit 003feef

Please sign in to comment.