1.. index:: cpp11-migrate 2 3=========================== 4cpp11-migrate User's Manual 5=========================== 6 7.. toctree:: 8 :hidden: 9 10 UseAutoTransform 11 UseNullptrTransform 12 LoopConvertTransform 13 14:program:`cpp11-migrate` is a standalone tool used to automatically convert 15C++98 and C++03 code to use features of the new C++11 standard where 16appropriate. 17 18Basic Usage 19=========== 20 21``cpp11-migrate [options] <source0> [... <sourceN>]`` 22 23``<source0>...`` specify the paths of files in the CMake source tree, 24with the same requirements as other tools built on LibTooling. 25 26Command Line Options 27-------------------- 28 29.. option:: -fatal-assembler-warnings 30 31 Treat all compiler warnings as errors. 32 33.. option:: -help 34 35 Displays tool usage instructions and command line options. 36 37.. option:: -loop-convert 38 39 Makes use of C++11 range-based for loops where possible. See 40 :doc:`LoopConvertTransform`. 41 42.. option:: -use-nullptr 43 44 Makes use of the new C++11 keyword ``nullptr`` where possible. 45 See :doc:`UseNullptrTransform`. 46 47.. option:: -use-auto 48 49 Replace the type specifier of variable declarations with the ``auto`` type 50 specifier. See :doc:`UseAutoTransform`. 51 52.. option:: -p=<build-path> 53 54 ``<build-path>`` is a CMake build directory containing a file named 55 ``compile_commands.json`` which provides compiler options for building 56 each source file and can be generated by specifying 57 ``-DCMAKE_EXPORT_COMPILE_COMMANDS`` when running CMake. If ``<build-path>`` 58 is not provided the ``compile_commands.json`` file is searched for through 59 all parent directories. 60 61 Alternatively, one can provide compile options to be applied to every 62 source file after the optional ``--``. 63 64.. option:: -risk=<risk-level> 65 66 Some transformations may cause a change in semantics. In such cases the 67 maximum acceptable risk level specified through the ``-risk`` command 68 line option decides whether or not a transformation is applied. 69 70 Three different risk level options are available: 71 72 ``-risk=safe`` 73 Perform only safe transformations. 74 ``-risk=reasonable`` (default) 75 Enable transformations that may change semantics. 76 ``-risk=risky`` 77 Enable transformations that are likely to change semantics. 78 79 The meaning of risk is handled differently for each transform. See 80 :ref:`transform documentation <transforms>` for details. 81 82 83.. option:: -version 84 85 Displays the version information of this tool. 86 87.. _transforms: 88 89Transformations 90=============== 91 92* :doc:`LoopConvertTransform` 93 94* :doc:`UseNullptrTransform` 95 96* :doc:`UseAutoTransform` 97