Skip to content

Commit 85ffc02

Browse files
committed
removed unnecessary friend declarations from checks
1 parent 9a97ccf commit 85ffc02

9 files changed

Lines changed: 0 additions & 28 deletions

lib/check64bit.h

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -41,8 +41,6 @@ class Tokenizer;
4141
*/
4242

4343
class CPPCHECKLIB Check64BitPortability : public Check {
44-
friend class Test64BitPortability;
45-
4644
public:
4745
/** This constructor is used when registering the Check64BitPortability */
4846
Check64BitPortability() : Check("64-bit portability") {}

lib/checkclass.h

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -49,10 +49,6 @@ enum class FunctionType : std::uint8_t;
4949

5050
/** @brief %Check classes. Uninitialized member variables, non-conforming operators, missing virtual destructor, etc */
5151
class CPPCHECKLIB CheckClass : public Check {
52-
friend class TestClass;
53-
friend class TestConstructors;
54-
friend class TestUnusedPrivateFunction;
55-
5652
public:
5753
/** @brief This constructor is used when registering the CheckClass */
5854
CheckClass() : Check("Class") {}

lib/checkio.h

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -42,8 +42,6 @@ enum class Severity : std::uint8_t;
4242

4343
/** @brief %Check input output operations. */
4444
class CPPCHECKLIB CheckIO : public Check {
45-
friend class TestIO;
46-
4745
public:
4846
/** @brief This constructor is used when registering CheckIO */
4947
CheckIO() : Check("IO using format string") {}

lib/checkmemoryleak.h

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -65,8 +65,6 @@ enum class Severity : std::uint8_t;
6565
*/
6666

6767
class CPPCHECKLIB CheckMemoryLeakInFunction : public Check {
68-
friend class TestMemleakInFunction;
69-
7068
public:
7169
/** @brief This constructor is used when registering this class */
7270
CheckMemoryLeakInFunction() : Check("Memory leaks (function variables)") {}
@@ -92,8 +90,6 @@ class CPPCHECKLIB CheckMemoryLeakInFunction : public Check {
9290
*/
9391

9492
class CPPCHECKLIB CheckMemoryLeakInClass : public Check {
95-
friend class TestMemleakInClass;
96-
9793
public:
9894
CheckMemoryLeakInClass() : Check("Memory leaks (class variables)") {}
9995

@@ -112,8 +108,6 @@ class CPPCHECKLIB CheckMemoryLeakInClass : public Check {
112108
/** @brief detect simple memory leaks for struct members */
113109

114110
class CPPCHECKLIB CheckMemoryLeakStructMember : public Check {
115-
friend class TestMemleakStructMember;
116-
117111
public:
118112
CheckMemoryLeakStructMember() : Check("Memory leaks (struct members)") {}
119113

@@ -132,8 +126,6 @@ class CPPCHECKLIB CheckMemoryLeakStructMember : public Check {
132126
/** @brief detect simple memory leaks (address not taken) */
133127

134128
class CPPCHECKLIB CheckMemoryLeakNoVar : public Check {
135-
friend class TestMemleakNoVar;
136-
137129
public:
138130
CheckMemoryLeakNoVar() : Check("Memory leaks (address not taken)") {}
139131

lib/checknullpointer.h

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -48,8 +48,6 @@ namespace ValueFlow
4848
/** @brief check for null pointer dereferencing */
4949

5050
class CPPCHECKLIB CheckNullPointer : public Check {
51-
friend class TestNullPointer;
52-
5351
public:
5452
/** @brief This constructor is used when registering the CheckNullPointer */
5553
CheckNullPointer() : Check("Null pointer") {}

lib/checkother.h

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -50,10 +50,6 @@ struct UnionMember;
5050
/** @brief Various small checks */
5151

5252
class CPPCHECKLIB CheckOther : public Check {
53-
friend class TestCharVar;
54-
friend class TestIncompleteStatement;
55-
friend class TestOther;
56-
5753
public:
5854
/** @brief This constructor is used when registering the CheckClass */
5955
CheckOther() : Check("Other") {}

lib/checkpostfixoperator.h

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -41,8 +41,6 @@ class Tokenizer;
4141
*/
4242

4343
class CPPCHECKLIB CheckPostfixOperator : public Check {
44-
friend class TestPostfixOperator;
45-
4644
public:
4745
/** This constructor is used when registering the CheckPostfixOperator */
4846
CheckPostfixOperator() : Check("Using postfix operators") {}

lib/checkuninitvar.h

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -58,8 +58,6 @@ struct VariableValue {
5858
/** @brief Checking for uninitialized variables */
5959

6060
class CPPCHECKLIB CheckUninitVar : public Check {
61-
friend class TestUninitVar;
62-
6361
public:
6462
/** @brief This constructor is used when registering the CheckUninitVar */
6563
CheckUninitVar() : Check("Uninitialized variables") {}

lib/checkunusedvar.h

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -43,8 +43,6 @@ class Tokenizer;
4343
/** @brief Various small checks */
4444

4545
class CPPCHECKLIB CheckUnusedVar : public Check {
46-
friend class TestUnusedVar;
47-
4846
public:
4947
/** @brief This constructor is used when registering the CheckClass */
5048
CheckUnusedVar() : Check("UnusedVar") {}

0 commit comments

Comments
 (0)