Commit 978777e
committed
Fix ODR violations in AUTOSAR A2-10-5 test
The CodeQL test framework assumes that all code will become part to the same
nameless link target, which means that the duplicate declarations of `test3`
and `test4` are ODR violations. Moreover, newer versions of the C/C++ frontend
used in the C/C++ extractor will implement CWG 2387, which means that the
instantiations of `number_two` will also cause ODR violations.
Fix the above by renaming `test3` and `test4` in `test`b.cpp` and making
the `number_two` variable templates `static`.1 parent 3e1205e commit 978777e
3 files changed
Lines changed: 6 additions & 6 deletions
File tree
- cpp/autosar/test/rules/A2-10-5
Lines changed: 2 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | 2 | | |
3 | | - | |
| 3 | + | |
4 | 4 | | |
5 | 5 | | |
6 | | - | |
| 6 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
14 | 14 | | |
15 | 15 | | |
16 | 16 | | |
17 | | - | |
| 17 | + | |
18 | 18 | | |
19 | 19 | | |
20 | 20 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
8 | 8 | | |
9 | 9 | | |
10 | 10 | | |
11 | | - | |
| 11 | + | |
12 | 12 | | |
13 | | - | |
| 13 | + | |
14 | 14 | | |
15 | | - | |
| 15 | + | |
0 commit comments