Skip to content

Commit 003feef

Browse files
committed
Exclude rvalue references from const in AUTOSAR rule 7-1-1.
1 parent 16bfd28 commit 003feef

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

cpp/autosar/src/rules/A7-1-1/DeclarationUnmodifiedObjectMissingConstSpecifier.ql

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,7 @@ where
3838
not exists(LambdaExpression lc | lc.getACapture().getField() = v) and
3939
not v.isFromUninstantiatedTemplate(_) and
4040
not v.isCompilerGenerated() and
41+
not v.getType() instanceof RValueReferenceType and
4142
//if the instantiation is not constexpr but the template is, still exclude it as a candidate
4243
not exists(TemplateVariable b | b.getAnInstantiation() = v and b.isConstexpr())
4344
select v, "Non-constant variable " + v.getName() + cond + " and is not modified."

0 commit comments

Comments
 (0)