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 703c3e9

Browse filesBrowse files
committed
Add test case for disapplied queries.
1 parent 61c33be commit 703c3e9
Copy full SHA for 703c3e9

File tree

Expand file treeCollapse file tree

3 files changed

+27
-0
lines changed
Filter options
Expand file treeCollapse file tree

3 files changed

+27
-0
lines changed
+1Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
| a0-1-6.cpp:1:7:1:7 | A | Unused type declaration A is not reported with reason 'The query is disapplied.'. |
+25Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
/**
2+
* @id cpp/guideline-recategorizations/disapplied-query
3+
* @name Query based on A0-1-6 to test disapplied category
4+
* @kind problem
5+
* @precision very-high
6+
* @problem.severity warning
7+
* @tags external/autosar/id/a0-1-6
8+
* external/autosar/obligation/advisory
9+
*/
10+
11+
import cpp
12+
import codingstandards.cpp.CodingStandards
13+
import codingstandards.cpp.TypeUses
14+
import codingstandards.cpp.exclusions.cpp.RuleMetadata
15+
16+
from UserType ut, string reason
17+
where
18+
isExcluded(ut, DeadCodePackage::unusedTypeDeclarationsQuery(), reason) and
19+
exists(ut.getFile()) and
20+
not ut instanceof TemplateParameter and
21+
not ut instanceof ProxyClass and
22+
not exists(getATypeUse(ut)) and
23+
not ut.isFromUninstantiatedTemplate(_)
24+
select ut,
25+
"Unused type declaration " + ut.getName() + " is not reported with reason '" + reason + "'."
+1Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
class A {}; // Unused type declaration

0 commit comments

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