Skip to content

'using namespace' in header file not taken into account #89

@WimLeflere

Description

@WimLeflere

With the following code, I get the message 'namespace_parent.h' does not need to be #included, which is incorrect.

parent.h

namespace parent
{
   class Parent {};
}

child.h

#include "namespace_parent.h"

using namespace parent;

namespace child
{
   class Child : Parent {};
}

The code compiles correctly but 'using namespace' in a header file is bad practice, so it might be better to give a warning that it is better to use full namespaces.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions