Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit 648f583

Browse filesBrowse files
committed
Address review comments
1 parent 29d0538 commit 648f583
Copy full SHA for 648f583

File tree

Expand file treeCollapse file tree

3 files changed

+8
-11
lines changed
Filter options
Expand file treeCollapse file tree

3 files changed

+8
-11
lines changed
+1-2Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,2 @@
11
- `A7-1-2` - `VariableMissingConstexpr.ql`:
2-
- Remove false positives for compiler generated variables
3-
- Remove results in uninstantiated templates that cause false positives
2+
- Fixes #607. Remove false positives for compiler generated variables and in uninstantiated templates

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

Copy file name to clipboardExpand all lines: cpp/autosar/src/rules/A7-1-2/VariableMissingConstexpr.ql
+1-1Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,4 +67,4 @@ where
6767
not v.isFromUninstantiatedTemplate(_) and
6868
// Exclude compiler generated variables, which are not user controllable
6969
not v.isCompilerGenerated()
70-
select v, "Variable " + v.getName() + " could be marked 'constexpr'."
70+
select v, "Variable '" + v.getName() + "' could be marked 'constexpr'."

‎cpp/autosar/test/rules/A7-1-2/test.cpp

Copy file name to clipboardExpand all lines: cpp/autosar/test/rules/A7-1-2/test.cpp
+6-8Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -266,14 +266,12 @@ constexpr void fp_reported_in_466(int p) {
266266
add4(1, l3); // COMPLIANT - l3 is not compile time constant on all paths
267267
}
268268

269-
template <typename T> T* init(T** t) { }
269+
template <typename T> T *init(T **t) {}
270270

271-
template <typename T> T* init() {
272-
T* t = nullptr; // COMPLIANT - initialized below
273-
init(&t); // Init is ignored in uninitialized template
274-
return t;
271+
template <typename T> T *init() {
272+
T *t = nullptr; // COMPLIANT - initialized below
273+
init(&t); // Init is ignored in uninitialized template
274+
return t;
275275
}
276276

277-
void test_template_instantiation() {
278-
int* t = init<int>();
279-
}
277+
void test_template_instantiation() { int *t = init<int>(); }

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.