Skip to content

Commit 383c449

Browse files
committed
Merge branch 'cpp-qcc-compile' of https://github.com/mbaluda/codeql-coding-standards into pr/mbaluda/304
2 parents 1064127 + d5073a8 commit 383c449

File tree

5 files changed

+33
-2
lines changed

5 files changed

+33
-2
lines changed

cpp/autosar/src/rules/A18-1-2/VectorboolSpecializationUsed.ql

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,12 @@ import cpp
1919
import codingstandards.cpp.autosar
2020

2121
predicate isVectorBool(ClassTemplateInstantiation c) {
22-
c.getNamespace() instanceof StdNamespace and
22+
(
23+
c.getNamespace() instanceof StdNamespace
24+
or
25+
c.getNamespace().isInline() and
26+
c.getNamespace().getParentNamespace() instanceof StdNamespace
27+
) and
2328
c.getTemplateArgument(0) instanceof BoolType and
2429
c.getSimpleName() = "vector"
2530
}

cpp/autosar/src/rules/A18-1-3/AutoPtrTypeUsed.ql

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,12 @@ import cpp
1717
import codingstandards.cpp.autosar
1818

1919
predicate isAutoPtr(ClassTemplateInstantiation c) {
20-
c.getNamespace() instanceof StdNamespace and
20+
(
21+
c.getNamespace() instanceof StdNamespace
22+
or
23+
c.getNamespace().isInline() and
24+
c.getNamespace().getParentNamespace() instanceof StdNamespace
25+
) and
2126
c.getSimpleName() = "auto_ptr"
2227
}
2328

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
| test.cpp:3:19:3:19 | g | Use of std::vector<bool> specialization. |
2+
| test.cpp:18:21:18:21 | l | Use of std::vector<bool> specialization. |
3+
| test.cpp:20:8:20:9 | l3 | Use of std::vector<bool> specialization. |
4+
| test.cpp:23:34:23:35 | l6 | Use of std::vector<bool> specialization. |
5+
| test.cpp:24:47:24:48 | l7 | Use of std::vector<bool> specialization. |
6+
| test.cpp:27:36:27:37 | it | Use of std::vector<bool> specialization. |
7+
| test.cpp:34:40:34:41 | d3 | Use of std::vector<bool> specialization. |
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
| test.cpp:3:19:3:19 | g | Use of std::vector<bool> specialization. |
2+
| test.cpp:18:21:18:21 | l | Use of std::vector<bool> specialization. |
3+
| test.cpp:20:8:20:9 | l3 | Use of std::vector<bool> specialization. |
4+
| test.cpp:23:34:23:35 | l6 | Use of std::vector<bool> specialization. |
5+
| test.cpp:24:47:24:48 | l7 | Use of std::vector<bool> specialization. |
6+
| test.cpp:27:36:27:37 | it | Use of std::vector<bool> specialization. |
7+
| test.cpp:34:40:34:41 | d3 | Use of std::vector<bool> specialization. |
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
| test.cpp:3:19:3:19 | g | Use of std::vector<bool> specialization. |
2+
| test.cpp:18:21:18:21 | l | Use of std::vector<bool> specialization. |
3+
| test.cpp:20:8:20:9 | l3 | Use of std::vector<bool> specialization. |
4+
| test.cpp:23:34:23:35 | l6 | Use of std::vector<bool> specialization. |
5+
| test.cpp:24:47:24:48 | l7 | Use of std::vector<bool> specialization. |
6+
| test.cpp:27:36:27:37 | it | Use of std::vector<bool> specialization. |
7+
| test.cpp:34:40:34:41 | d3 | Use of std::vector<bool> specialization. |

0 commit comments

Comments
 (0)