We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 9a9138a commit e1521adCopy full SHA for e1521ad
cpp/autosar/src/rules/A5-1-1/LiteralValueUsedOutsideTypeInit.ql
@@ -53,6 +53,10 @@ where
53
not l = any(ArrayOrVectorAggregateLiteral aal).getAnElementExpr(_).getAChild*() and
54
// Ignore x - 1 expressions
55
not exists(SubExpr se | se.getRightOperand() = l and l.getValue() = "1") and
56
+ // Exclude compile time computed integral literals as they can appear as integral literals
57
+ // when used as non-type template arguments.
58
+ // We limit ourselves to integral literals, because floating point literals as non-type
59
+ // template arguments are not supported in C++ 14. Those are supported shince C++ 20.
60
not l instanceof CompileTimeComputedIntegralLiteral and
61
// Exclude literals to instantiate a class template per example in the standard
62
// where an type of std::array is intialized with size 5.
0 commit comments