Skip to content

Commit 5ccc149

Browse files
committed
Remove false_negative cases
These actually can be detected!
1 parent 3293d4f commit 5ccc149

File tree

1 file changed

+20
-25
lines changed
  • cpp/misra/test/rules/RULE-21-6-3

1 file changed

+20
-25
lines changed

cpp/misra/test/rules/RULE-21-6-3/test.cpp

Lines changed: 20 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -9,36 +9,31 @@
99
*/
1010
class C1 {
1111
public:
12-
C1() {}
13-
14-
// Class-specific operator declarations - NON_COMPLIANT[FALSE_NEGATIVE] (any
15-
// signature)
16-
void *operator new(std::size_t size); // NON_COMPLIANT[FALSE_NEGATIVE]:
17-
// class-specific declaration
18-
void *operator new[](std::size_t size); // NON_COMPLIANT[FALSE_NEGATIVE]:
19-
// class-specific declaration
20-
void operator delete(void *ptr) noexcept; // NON_COMPLIANT[FALSE_NEGATIVE]:
21-
// class-specific declaration
22-
void operator delete[](void *ptr) noexcept; // NON_COMPLIANT[FALSE_NEGATIVE]:
23-
// class-specific declaration
12+
// Class-specific operator declarations - NON_COMPLIANT (any signature)
13+
void *
14+
operator new(std::size_t size); // NON_COMPLIANT: class-specific declaration
15+
void *
16+
operator new[](std::size_t size); // NON_COMPLIANT: class-specific declaration
17+
void operator delete(
18+
void *ptr) noexcept; // NON_COMPLIANT: class-specific declaration
19+
void operator delete[](
20+
void *ptr) noexcept; // NON_COMPLIANT: class-specific declaration
2421
void *operator new(
2522
std::size_t size,
26-
const std::nothrow_t &) noexcept; // NON_COMPLIANT[FALSE_NEGATIVE]:
27-
// class-specific nothrow declaration
23+
const std::nothrow_t &) noexcept; // NON_COMPLIANT: class-specific
24+
// nothrow declaration
25+
void *operator new(std::size_t size,
26+
void *ptr) noexcept; // NON_COMPLIANT: class-specific
27+
// placement declaration
28+
void *operator new[](std::size_t size,
29+
void *ptr) noexcept; // NON_COMPLIANT: class-specific
30+
// placement declaration
2831
void *
2932
operator new(std::size_t size,
30-
void *ptr) noexcept; // NON_COMPLIANT[FALSE_NEGATIVE]:
31-
// class-specific placement declaration
33+
int hint); // NON_COMPLIANT: class-specific custom declaration
3234
void *
33-
operator new[](std::size_t size,
34-
void *ptr) noexcept; // NON_COMPLIANT[FALSE_NEGATIVE]:
35-
// class-specific placement declaration
36-
void *operator new(std::size_t size,
37-
int hint); // NON_COMPLIANT[FALSE_NEGATIVE]: class-specific
38-
// custom declaration
39-
void *operator new(std::size_t size, double alignment,
40-
int pool); // NON_COMPLIANT[FALSE_NEGATIVE]: class-specific
41-
// custom declaration
35+
operator new(std::size_t size, double alignment,
36+
int pool); // NON_COMPLIANT: class-specific custom declaration
4237
};
4338

4439
/**

0 commit comments

Comments
 (0)