Skip to content

Commit f253bad

Browse files
committed
A0-4-3 qcc expected file
A4-10-1 clang test/expected file A18-1-2 clang expected file
1 parent f43cf3e commit f253bad

File tree

4 files changed

+24
-7
lines changed

4 files changed

+24
-7
lines changed
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
| test.cpp:0:0:0:0 | test.cpp | File 'test.cpp' compiled with flag '-std=gnu++11' which does not strictly comply with ISO C++14. |

cpp/autosar/test/rules/A18-1-2/VectorboolSpecializationUsed.expected.clang

Lines changed: 0 additions & 7 deletions
This file was deleted.
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
| test.cpp:10:13:10:13 | 0 | 0 is used as the null-pointer-constant but is not nullptr. |
2+
| test.cpp:11:6:11:6 | 0 | 0 is used as the null-pointer-constant but is not nullptr. |
3+
| test.cpp:17:6:17:9 | 0 | NULL is used as the null-pointer-constant but is not nullptr. |
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
void f1(int *x);
2+
void f2(int x);
3+
void f3(char *x);
4+
// Template function which forwards to a pointer function
5+
template <typename F, typename X> void f3(F f, X x) { f1(x); }
6+
7+
#define NULL 0
8+
9+
void test_nullptr() {
10+
int *l1 = 0; // NON_COMPLIANT - 0 converted to a pointer type
11+
f1(0); // NON_COMPLIANT - 0 converted to a pointer type
12+
int *l2 = nullptr; // COMPLIANT - use of nullptr
13+
f1(nullptr); // COMPLIANT - use of nullptr
14+
f2(0); // COMPLIANT - use of 0 literal with no conversion to pointer
15+
int l3 = 0; // COMPLIANT - use of 0 literal with no conversion to pointer
16+
f3(f1, nullptr); // COMPLIANT - use of nullptr
17+
f1(NULL); // NON_COMPLIANT - use of NULL macro
18+
// f1('\0'); // NON_COMPLIANT - use of octal escape 0 - this is compiler checked
19+
f3("0"); // COMPLIANT - "0" is not a literal zero
20+
}

0 commit comments

Comments
 (0)