cppclean
cppclean copied to clipboard
Warns on local function definition
cppclean warns on local function that defined in implementation file: "source.cpp:1: 'foo' not found in any directly #included header"
// source.cpp
void foo() {}
int main() { return 0; }
Hi,
Also friend boolean operator overloads get the same error.
type.h
class Type {
public:
friend bool operator==(const Type& a, const Type&b);
private:
int number = 0;
}
type.cpp
#include "type.h"
bool operator==(const Type& a, const Type&b) {
return a.number == b.number;
}