Skip to content

Commit ba39b68

Browse files
committed
Exclude literals part of a class aggregate literal
1 parent 24b4a00 commit ba39b68

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

cpp/autosar/src/rules/A5-1-1/LiteralValueUsedOutsideTypeInit.ql

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,5 +56,6 @@ where
5656
not l instanceof CompileTimeComputedIntegralLiteral and
5757
// Exclude literals to instantiate a class template per example in the standard
5858
// where an type of std::array is intialized with size 5.
59-
not l = any(ClassTemplateInstantiation cti).getATemplateArgument()
59+
not l = any(ClassTemplateInstantiation cti).getATemplateArgument() and
60+
not l = any(ClassAggregateLiteral cal).getAFieldExpr(_)
6061
select l, "Literal value '" + getTruncatedLiteralText(l) + "' used outside of type initialization."

0 commit comments

Comments
 (0)