summaryrefslogtreecommitdiffstats
path: root/clang-tools-extra/docs/clang-tidy
diff options
context:
space:
mode:
authorPiotr Padlewski <piotr.padlewski@gmail.com>2016-04-29 17:58:29 +0000
committerPiotr Padlewski <piotr.padlewski@gmail.com>2016-04-29 17:58:29 +0000
commit5625f656678a7d03fa65398d6d751dc88cba75a8 (patch)
tree68a9658777a1f669875f5ebd26a96572140d0c89 /clang-tools-extra/docs/clang-tidy
parent46977b62aaaca7a5853a6e3eeabc0adc8f53ef32 (diff)
downloadbcm5719-llvm-5625f656678a7d03fa65398d6d751dc88cba75a8.tar.gz
bcm5719-llvm-5625f656678a7d03fa65398d6d751dc88cba75a8.zip
Add boost-use-to-string
http://reviews.llvm.org/D18136 llvm-svn: 268079
Diffstat (limited to 'clang-tools-extra/docs/clang-tidy')
-rw-r--r--clang-tools-extra/docs/clang-tidy/checks/boost-use-to-string.rst22
-rw-r--r--clang-tools-extra/docs/clang-tidy/checks/list.rst4
-rw-r--r--clang-tools-extra/docs/clang-tidy/index.rst2
3 files changed, 27 insertions, 1 deletions
diff --git a/clang-tools-extra/docs/clang-tidy/checks/boost-use-to-string.rst b/clang-tools-extra/docs/clang-tidy/checks/boost-use-to-string.rst
new file mode 100644
index 00000000000..ebeb82916c8
--- /dev/null
+++ b/clang-tools-extra/docs/clang-tidy/checks/boost-use-to-string.rst
@@ -0,0 +1,22 @@
+.. title:: clang-tidy - boost-use-to-string
+
+boost-use-to-string
+===================
+
+This check finds conversion from integer type like ``int`` to ``std::string`` or
+``std::wstring`` using ``boost::lexical_cast``, and replace it with calls to
+``std::to_string`` and ``std::to_wstring``.
+
+It doesn't replace conversion from floating points despite the ``to_string``
+overloads, because it would change the behaviour.
+
+
+ .. code-block:: c++
+
+ auto str = boost::lexical_cast<std::string>(42);
+ auto wstr = boost::lexical_cast<std::wstring>(2137LL);
+
+ // Will be changed to
+ auto str = std::to_string(42);
+ auto wstr = std::to_wstring(2137LL);
+
diff --git a/clang-tools-extra/docs/clang-tidy/checks/list.rst b/clang-tools-extra/docs/clang-tidy/checks/list.rst
index c85d7e73b72..267eb314017 100644
--- a/clang-tools-extra/docs/clang-tidy/checks/list.rst
+++ b/clang-tools-extra/docs/clang-tidy/checks/list.rst
@@ -3,7 +3,9 @@
Clang-Tidy Checks
=========================
-.. toctree::
+.. toctree::
+
+ boost-use-to-string
cert-dcl03-c (redirects to misc-static-assert) <cert-dcl03-c>
cert-dcl50-cpp
cert-dcl54-cpp (redirects to misc-new-delete-overloads) <cert-dcl54-cpp>
diff --git a/clang-tools-extra/docs/clang-tidy/index.rst b/clang-tools-extra/docs/clang-tidy/index.rst
index d7e076cab6a..3fc0d35ed9b 100644
--- a/clang-tools-extra/docs/clang-tidy/index.rst
+++ b/clang-tools-extra/docs/clang-tidy/index.rst
@@ -67,6 +67,8 @@ There are currently the following groups of checks:
* Clang static analyzer checks are named starting with ``clang-analyzer-``.
+* Checks related to Boost library starts with ``boost-``.
+
Clang diagnostics are treated in a similar way as check diagnostics. Clang
diagnostics are displayed by clang-tidy and can be filtered out using
``-checks=`` option. However, the ``-checks=`` option does not affect
OpenPOWER on IntegriCloud