-
Notifications
You must be signed in to change notification settings - Fork 77
Expand file tree
/
Copy pathtest.cpp
More file actions
36 lines (26 loc) · 762 Bytes
/
test.cpp
File metadata and controls
36 lines (26 loc) · 762 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
#include <array>
#include <string_view>
int g[100]; // NON_COMPLIANT
class C {
public:
static constexpr int a[1]{0}; // NON_COMPLIANT
int a1[1]; // NON_COMPLIANT
};
struct S {
int a1[1]; // NON_COMPLIANT
};
void test_c_arrays() {
int x[100]; // NON_COMPLIANT
constexpr int a[]{0, 1, 2}; // NON_COMPLIANT
const size_t s{1};
char x1[s]; // NON_COMPLIANT
std::array<char, s> x2; // COMPLIANT
__func__; // COMPLIANT
}
char g1[] = "abc"; // NON_COMPLIANT
const char g2[] = "abc"; // COMPLIANT
using namespace std::literals;
const auto g3 = "abc"sv; // COMPLIANT
void param_test(int p[1], int (&p1)[1], int (*p2)[1],
int *p3) { // NON_COMPLIANT -- p, rest are compliant
}