diff options
Diffstat (limited to 'clang-tools-extra/docs')
| -rw-r--r-- | clang-tools-extra/docs/clang-tidy/checks/list.rst | 1 | ||||
| -rw-r--r-- | clang-tools-extra/docs/clang-tidy/checks/misc-forward-declaration-namespace.rst | 19 |
2 files changed, 20 insertions, 0 deletions
diff --git a/clang-tools-extra/docs/clang-tidy/checks/list.rst b/clang-tools-extra/docs/clang-tidy/checks/list.rst index b0ae6d8797c..68eb5a6d3c9 100644 --- a/clang-tools-extra/docs/clang-tidy/checks/list.rst +++ b/clang-tools-extra/docs/clang-tidy/checks/list.rst @@ -51,6 +51,7 @@ Clang-Tidy Checks misc-assign-operator-signature misc-bool-pointer-implicit-conversion misc-definitions-in-headers + misc-forward-declaration-namespace misc-inaccurate-erase misc-incorrect-roundings misc-inefficient-algorithm diff --git a/clang-tools-extra/docs/clang-tidy/checks/misc-forward-declaration-namespace.rst b/clang-tools-extra/docs/clang-tidy/checks/misc-forward-declaration-namespace.rst new file mode 100644 index 00000000000..c8527b09fcd --- /dev/null +++ b/clang-tools-extra/docs/clang-tidy/checks/misc-forward-declaration-namespace.rst @@ -0,0 +1,19 @@ +.. title:: clang-tidy - misc-forward-declaration-namespace + +misc-forward-declaration-namespace +================================== + +Checks if an unused forward declaration is in a wrong namespace. + +The check inspects all unused forward declarations and checks if there is any +declaration/definition with the same name existing, which could indicate that +the forward declaration is in a potentially wrong namespace. + +.. code:: c++ + namespace na { struct A; } + namespace nb { struct A {}; } + nb::A a; + // warning : no definition found for 'A', but a definition with the same name + // 'A' found in another namespace 'nb::' + +This check can only generate warnings, but it can't suggest a fix at this point. |

