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 f5a1fc2

Browse filesBrowse files
committed
Address review comments
1 parent 17f3a32 commit f5a1fc2
Copy full SHA for f5a1fc2

File tree

Expand file treeCollapse file tree

3 files changed

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

3 files changed

+8
-7
lines changed
+2Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
- `M0-1-3` - `UnusedGlobalOrNamespaceVariable.ql`
2+
- Reduces false positives by excluding compiler generated variables, and variables in uninstantiated templates.

‎cpp/autosar/test/rules/M0-1-3/test.cpp

Copy file name to clipboardExpand all lines: cpp/autosar/test/rules/M0-1-3/test.cpp
+1-1Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,7 @@ template <bool... Args> extern constexpr bool all_of_v = true; // COMPLIANT
8383

8484
template <bool B1, bool... Args>
8585
extern constexpr bool all_of_v<B1, Args...> =
86-
B1 && all_of_v<Args...>; // COMPLIANT
86+
B1 &&all_of_v<Args...>; // COMPLIANT
8787

8888
void test_template_variable() { all_of_v<true, true, true>; }
8989

‎cpp/common/src/codingstandards/cpp/deadcode/UnusedVariables.qll

Copy file name to clipboardExpand all lines: cpp/common/src/codingstandards/cpp/deadcode/UnusedVariables.qll
+5-6Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -48,12 +48,11 @@ class PotentiallyUnusedLocalVariable extends LocalVariable {
4848
not exists(AsmStmt s | f = s.getEnclosingFunction()) and
4949
// Ignore functions with error expressions as they indicate expressions that the extractor couldn't process
5050
not any(ErrorExpr e).getEnclosingFunction() = f
51-
)
52-
// ) and
53-
// // exclude uninstantiated template members
54-
// not this.isFromUninstantiatedTemplate(_) and
55-
// // Do not report compiler generated variables
56-
// not this.isCompilerGenerated()
51+
) and
52+
// exclude uninstantiated template members
53+
not this.isFromUninstantiatedTemplate(_) and
54+
// Do not report compiler generated variables
55+
not this.isCompilerGenerated()
5756
}
5857
}
5958

0 commit comments

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