cppclean icon indicating copy to clipboard operation
cppclean copied to clipboard

Warns on local function definition

Open akhranovsky opened this issue 8 years ago • 1 comments

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; }

akhranovsky avatar Dec 14 '17 15:12 akhranovsky

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;
}

drodil avatar Feb 20 '18 06:02 drodil