forked from github/codeql-coding-standards
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtest.hpp
More file actions
26 lines (19 loc) · 757 Bytes
/
test.hpp
File metadata and controls
26 lines (19 loc) · 757 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
void f(); // COMPLIANT
void f1() {} // NON_COMPLIANT
inline void f2() {} // COMPLIANT
template <typename T> void f3(T){}; // COMPLIANT - implicitly inline
int i; // NON_COMPLIANT
extern int i1 = 1; // NON_COMPLIANT
constexpr auto i2{1}; // COMPLIANT - not external linkage
struct S {
int i; // COMPLIANT - no linkage
inline static const int i1{1}; // COMPLIANT - inline
};
class C {
static int m(); // COMPLIANT
int m1(); // COMPLIANT
};
int C::m() {} // NON_COMPLIANT[FALSE_NEGATIVE] - external linkage library
// issue/namespace of class not found
int C::m1() {} // NON_COMPLIANT[FALSE_NEGATIVE] - external linkage library
// issue/namespace of class not found