summaryrefslogtreecommitdiffstats
path: root/clang-tools-extra/docs/clang-tidy
diff options
context:
space:
mode:
authorAaron Ballman <aaron@aaronballman.com>2015-10-06 13:31:00 +0000
committerAaron Ballman <aaron@aaronballman.com>2015-10-06 13:31:00 +0000
commitaaa4080d21ecc6a68221ddea558726950c719b17 (patch)
tree5d69206b7a5ed9d3c9e7dfe59bf96ca4bab87e13 /clang-tools-extra/docs/clang-tidy
parent814e5caebcd0ee7346be03bea0aab6221c09ebbe (diff)
downloadbcm5719-llvm-aaa4080d21ecc6a68221ddea558726950c719b17.tar.gz
bcm5719-llvm-aaa4080d21ecc6a68221ddea558726950c719b17.zip
Add a new module for the C++ Core Guidelines, and the first checker for those guidelines: cppcoreguidelines-pro-type-reinterpret-cast.
Patch by Matthias Gehre! llvm-svn: 249399
Diffstat (limited to 'clang-tools-extra/docs/clang-tidy')
-rw-r--r--clang-tools-extra/docs/clang-tidy/checks/cppcoreguidelines-pro-type-reinterpret-cast.rst9
-rw-r--r--clang-tools-extra/docs/clang-tidy/checks/list.rst1
2 files changed, 10 insertions, 0 deletions
diff --git a/clang-tools-extra/docs/clang-tidy/checks/cppcoreguidelines-pro-type-reinterpret-cast.rst b/clang-tools-extra/docs/clang-tidy/checks/cppcoreguidelines-pro-type-reinterpret-cast.rst
new file mode 100644
index 00000000000..73345387e74
--- /dev/null
+++ b/clang-tools-extra/docs/clang-tidy/checks/cppcoreguidelines-pro-type-reinterpret-cast.rst
@@ -0,0 +1,9 @@
+cppcoreguidelines-pro-type-reinterpret-cast
+===========================================
+
+This check flags all uses of reinterpret_cast in C++ code.
+
+Use of these casts can violate type safety and cause the program to access a variable that is actually of type X to be accessed as if it were of an unrelated type Z.
+
+This rule is part of the "Type safety" profile of the C++ Core Guidelines, see
+https://github.com/isocpp/CppCoreGuidelines/blob/master/CppCoreGuidelines.md#-type1-dont-use-reinterpret_cast.
diff --git a/clang-tools-extra/docs/clang-tidy/checks/list.rst b/clang-tools-extra/docs/clang-tidy/checks/list.rst
index 03a9af8b3e7..8427bbf27c3 100644
--- a/clang-tools-extra/docs/clang-tidy/checks/list.rst
+++ b/clang-tools-extra/docs/clang-tidy/checks/list.rst
@@ -3,6 +3,7 @@ List of clang-tidy Checks
.. toctree::
cert-variadic-function-def
+ cppcoreguidelines-pro-type-reinterpret-cast
google-build-explicit-make-pair
google-build-namespaces
google-build-using-namespace
OpenPOWER on IntegriCloud