Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Warns on local function definition #124

Open
akhranovsky opened this issue Dec 14, 2017 · 1 comment
Open

Warns on local function definition #124

akhranovsky opened this issue Dec 14, 2017 · 1 comment

Comments

@akhranovsky
Copy link

akhranovsky commented Dec 14, 2017

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 akhranovsky changed the title cppclean warns on local function definition Warns on local function definition Dec 14, 2017
@drodil
Copy link

drodil commented Feb 20, 2018

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants