Skip to content

Commit 28f54a7

Browse files
committed
Revert "Exclude non-static members"
This reverts commit 7361106. The change was incorrect and caused the rule to miss some cases.
1 parent b7df30e commit 28f54a7

File tree

2 files changed

+2
-5
lines changed

2 files changed

+2
-5
lines changed
Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,2 @@
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.
3-
- Exclude member that aren't `static`, because they cannot be `constexpr`.
2+
- Fix FP reported in #466. Addresses incorrect assumption that calls to `constexpr` functions are always compile-time evaluated.

cpp/autosar/src/rules/A7-1-2/VariableMissingConstexpr.ql

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,5 @@ where
8989
// Not assigned by a user in a constructor
9090
not exists(ConstructorFieldInit cfi | cfi.getTarget() = v and not cfi.isCompilerGenerated()) and
9191
// Ignore union members
92-
not v.getDeclaringType() instanceof Union and
93-
// If it is a member, it must be static to be constexpr
94-
(v instanceof MemberVariable implies v.isStatic())
92+
not v.getDeclaringType() instanceof Union
9593
select v, "Variable " + v.getName() + " could be marked 'constexpr'."

0 commit comments

Comments
 (0)