Skip to content

Commit 7e4d625

Browse files
committed
A18-1-2: inline namespace std::__1::vector<bool>
1 parent 0e882ed commit 7e4d625

File tree

4 files changed

+27
-1
lines changed

4 files changed

+27
-1
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
}
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)