summaryrefslogtreecommitdiffstats
path: root/clang-tools-extra/docs/clang-tidy
diff options
context:
space:
mode:
authorAlexander Kornienko <alexfh@google.com>2016-02-24 13:36:34 +0000
committerAlexander Kornienko <alexfh@google.com>2016-02-24 13:36:34 +0000
commite4a75fd8965c38d4b96bd202a4de74d7132639bd (patch)
tree7d159868f460549511b90780e1ae06f9238fa0aa /clang-tools-extra/docs/clang-tidy
parentea9fd99215088b136c224d40074f2faa735a073b (diff)
downloadbcm5719-llvm-e4a75fd8965c38d4b96bd202a4de74d7132639bd.tar.gz
bcm5719-llvm-e4a75fd8965c38d4b96bd202a4de74d7132639bd.zip
[clang-tidy] introduce modernize-deprecated-headers check
Summary: This patch introduces the modernize-deprecated-headers check, which is supposed to replace deprecated C library headers with the C++ STL-ones. For information see documentation; for exmaples see the test cases. Reviewers: Eugene.Zelenko, LegalizeAdulthood, alexfh Subscribers: cfe-commits Patch by Kirill Bobyrev! Differential Revision: http://reviews.llvm.org/D17484 llvm-svn: 261738
Diffstat (limited to 'clang-tools-extra/docs/clang-tidy')
-rw-r--r--clang-tools-extra/docs/clang-tidy/checks/list.rst1
-rw-r--r--clang-tools-extra/docs/clang-tidy/checks/modernize-deprecated-headers.rst45
2 files changed, 46 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 68eb5a6d3c9..6b06e92b0a6 100644
--- a/clang-tools-extra/docs/clang-tidy/checks/list.rst
+++ b/clang-tools-extra/docs/clang-tidy/checks/list.rst
@@ -74,6 +74,7 @@ Clang-Tidy Checks
misc-unused-parameters
misc-unused-raii
misc-virtual-near-miss
+ modernize-deprecated-headers
modernize-loop-convert
modernize-make-unique
modernize-pass-by-value
diff --git a/clang-tools-extra/docs/clang-tidy/checks/modernize-deprecated-headers.rst b/clang-tools-extra/docs/clang-tidy/checks/modernize-deprecated-headers.rst
new file mode 100644
index 00000000000..9a06316e332
--- /dev/null
+++ b/clang-tools-extra/docs/clang-tidy/checks/modernize-deprecated-headers.rst
@@ -0,0 +1,45 @@
+.. title:: clang-tidy - modernize-deprecated-headers
+
+modernize-deprecated-headers
+==========================
+
+Some headers from C library were deprecated in C++ and are no longer welcome in
+C++ codebases. For more details refer to the C++ 14 Standard [depr.c.headers]
+section.
+
+This check replaces C standard library headers with their C++ alternatives.
+
+Improtant note: the Standard doesn't guarantee that the C++ headers declare all
+the same functions in the global namespace. The check in its current form can
+break the code that uses library symbols from the global namespace.
+
+* `<assert.h>`
+* `<complex.h>`
+* `<ctype.h>`
+* `<errno.h>`
+* `<fenv.h>` // deprecated since C++11
+* `<float.h>`
+* `<inttypes.h>`
+* `<iso646.h>`
+* `<limits.h>`
+* `<locale.h>`
+* `<math.h>`
+* `<setjmp.h>`
+* `<signal.h>`
+* `<stdalign.h>` // deprecated since C++11
+* `<stdarg.h>`
+* `<stdbool.h>` // deprecated since C++11
+* `<stddef.h>`
+* `<stdint.h>`
+* `<stdio.h>`
+* `<stdlib.h>`
+* `<string.h>`
+* `<tgmath.h>` // deprecated since C++11
+* `<time.h>`
+* `<uchar.h>` // deprecated since C++11
+* `<wchar.h>`
+* `<wctype.h>`
+
+If the specified standard is older than C++11 the check will only replace
+headers deprecated before C++11, otherwise -- every header that appeared in
+the list.
OpenPOWER on IntegriCloud