File tree Expand file tree Collapse file tree 2 files changed +5
-2
lines changed
cpp/autosar/src/rules/A7-1-2 Expand file tree Collapse file tree 2 files changed +5
-2
lines changed Original file line number Diff line number Diff line change 11` A7-1-2 ` - ` VariableMissingConstexpr.ql ` :
2- - Fix FP reported in #466 . Addresses incorrect assumption that calls to ` constexpr ` functions are always compile-time evaluated.
2+ - Fix FP reported in #466 . Addresses incorrect assumption that calls to ` constexpr ` functions are always compile-time evaluated.
3+ - Exclude member that aren't ` static ` , because they cannot be ` constexpr ` .
Original file line number Diff line number Diff line change 8181 // Not assigned by a user in a constructor
8282 not exists ( ConstructorFieldInit cfi | cfi .getTarget ( ) = v and not cfi .isCompilerGenerated ( ) ) and
8383 // Ignore union members
84- not v .getDeclaringType ( ) instanceof Union
84+ not v .getDeclaringType ( ) instanceof Union and
85+ // If it is a member, it must be static to be constexpr
86+ ( v instanceof MemberVariable implies v .isStatic ( ) )
8587select v , "Variable " + v .getName ( ) + " could be marked 'constexpr'."
You can’t perform that action at this time.
0 commit comments