diff options
Diffstat (limited to 'clang-tools-extra/docs')
4 files changed, 34 insertions, 1 deletions
diff --git a/clang-tools-extra/docs/ReleaseNotes.rst b/clang-tools-extra/docs/ReleaseNotes.rst index fe40386c720..a97aeb949b1 100644 --- a/clang-tools-extra/docs/ReleaseNotes.rst +++ b/clang-tools-extra/docs/ReleaseNotes.rst @@ -217,6 +217,13 @@ identified. The improvements since the 3.8 release include: Finds static function and variable definitions in anonymous namespace. + - New Boost module containing checks for issues with Boost library + +- New `boost-use-to-string + <http://clang.llvm.org/extra/clang-tidy/checks/boost-use-to-string.html>`_ check + + Finds usages of boost::lexical_cast<std::string> and changes it to std::to_string. + Fixed bugs: - Crash when running on compile database with relative source files paths. 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 |

