From 5625f656678a7d03fa65398d6d751dc88cba75a8 Mon Sep 17 00:00:00 2001 From: Piotr Padlewski Date: Fri, 29 Apr 2016 17:58:29 +0000 Subject: Add boost-use-to-string http://reviews.llvm.org/D18136 llvm-svn: 268079 --- .../docs/clang-tidy/checks/boost-use-to-string.rst | 22 ++++++++++++++++++++++ clang-tools-extra/docs/clang-tidy/checks/list.rst | 4 +++- clang-tools-extra/docs/clang-tidy/index.rst | 2 ++ 3 files changed, 27 insertions(+), 1 deletion(-) create mode 100644 clang-tools-extra/docs/clang-tidy/checks/boost-use-to-string.rst (limited to 'clang-tools-extra/docs/clang-tidy') 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(42); + auto wstr = boost::lexical_cast(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-dcl50-cpp cert-dcl54-cpp (redirects to misc-new-delete-overloads) 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 -- cgit v1.2.3