summaryrefslogtreecommitdiffstats
path: root/clang-tools-extra/docs/clang-tidy/checks/misc-forward-declaration-namespace.rst
diff options
context:
space:
mode:
Diffstat (limited to 'clang-tools-extra/docs/clang-tidy/checks/misc-forward-declaration-namespace.rst')
-rw-r--r--clang-tools-extra/docs/clang-tidy/checks/misc-forward-declaration-namespace.rst19
1 files changed, 19 insertions, 0 deletions
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.
OpenPOWER on IntegriCloud