1.. title:: clang-tidy - bugprone-forward-declaration-namespace
2
3bugprone-forward-declaration-namespace
4======================================
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 any
9declaration/definition with the same name existing, which could indicate that
10the 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 name
18  // 'A' found in another namespace 'nb::'
19
20This check can only generate warnings, but it can't suggest a fix at this point.
21