22 lines · plain
1.. title:: clang-tidy - bugprone-forward-declaration-namespace2 3bugprone-forward-declaration-namespace4======================================5 6Checks if an unused forward declaration is in a wrong namespace.7 8The check inspects all unused forward declarations and checks if there is any9declaration/definition with the same name existing, which could indicate that10the forward declaration is in a potentially wrong namespace.11 12.. code-block:: c++13 14 namespace na { struct A; }15 namespace nb { struct A {}; }16 nb::A a;17 // warning : no definition found for 'A', but a definition with the same name18 // 'A' found in another namespace 'nb::'19 20This check can only generate warnings, but it can't suggest a fix at this21point.22