Index: docs/ReleaseNotes.rst =================================================================== --- docs/ReleaseNotes.rst +++ docs/ReleaseNotes.rst @@ -63,11 +63,77 @@ explain them more clearly, and provide more accurate fix-its for the issues identified. The improvements since the 3.8 release include: -- New ``modernize-raw-string-literal`` check +- New `cert-env33-c` check - This check selectively replaces string literals containing escaped - characters with raw string literals. + Flags calls to ``system()``, ``popen()``, and ``_popen()``, which execute a + command processor. +- New `cert-flp30-c` check + + Flags ``for`` loops where the induction expression has a floating-point type. + +- New `cppcoreguidelines-pro-type-member-init` check + + Flags user-defined constructor definitions that do not initialize all builtin + and pointer fields which leaves their memory in an undefined state. + +- New `misc-dangling-handle` check + + Detects dangling references in value handlers like + ``std::experimental::string_view``. + +- New `misc-forward-declaration-namespace` check + + Checks if an unused forward declaration is in a wrong namespace. + +- New `misc-misplaced-widening-cast` check + + Warns when there is a explicit redundant cast of a calculation result to a + bigger type. + +- New `misc-suspicious-semicolon` check + + Finds most instances of stray semicolons that unexpectedly alter the meaning + of the code. + +- New `modernize-deprecated-headers` check + + Replaces C standard library headers with their C++ alternatives. + +- New `modernize-raw-string-literal` check + + Selectively replaces string literals containing escaped characters with raw + string literals. + +- New `performance-faster-string-find` check + + Optimize calls to ``std::string::find()`` and friends when the needle passed + is a single character string literal. + +- New `performance-implicit-cast-in-loop` check + + Warns about range-based loop with a loop variable of const ref type where the + type of the variable does not match the one returned by the iterator. + +- New `performance-unnecessary-value-param` check + + Flags value parameter declarations of expensive to copy types that are copied + for each invocation but it would suffice to pass them by const reference. + +- New `readability-redundant-control-flow` check + + Looks for procedures (functions returning no value) with ``return`` statements + at the end of the function. Such `return` statements are redundant. + +- New `readability-redundant-string-init` check + + Finds unnecessary string initializations. + +Fixed bugs: + + Crash when :program:`clang-tidy` runs on compile database with relative source files + paths. + Clang-tidy changes from 3.7 to 3.8 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ Index: docs/clang-tidy/checks/misc-dangling-handle.rst =================================================================== --- docs/clang-tidy/checks/misc-dangling-handle.rst +++ docs/clang-tidy/checks/misc-dangling-handle.rst @@ -4,12 +4,12 @@ ==================== Detect dangling references in value handlers like -`std::experimental::string_view`. +``std::experimental::string_view``. These dangling references can come from constructing handles from temporary values, where the temporary is destroyed soon after the handle is created. -By default only `std::experimental::basic_string_view` is considered. -This list can be modified by passing a ; separated list of class names using +By default only ``std::experimental::basic_string_view`` is considered. +This list can be modified by passing a `;` separated list of class names using the HandleClasses option. Examples: Index: docs/clang-tidy/checks/performance-faster-string-find.rst =================================================================== --- docs/clang-tidy/checks/performance-faster-string-find.rst +++ docs/clang-tidy/checks/performance-faster-string-find.rst @@ -3,11 +3,11 @@ performance-faster-string-find ============================== -Optimize calls to std::string::find() and friends when the needle passed is +Optimize calls to ``std::string::find()`` and friends when the needle passed is a single character string literal. The character literal overload is more efficient. -By default only `std::basic_string` is considered. This list can be modified by +By default only ``std::basic_string`` is considered. This list can be modified by passing a `;` separated list of class names using the `StringLikeClasses` option. The methods to consired are fixed, though. Index: docs/clang-tidy/checks/performance-implicit-cast-in-loop.rst =================================================================== --- docs/clang-tidy/checks/performance-implicit-cast-in-loop.rst +++ docs/clang-tidy/checks/performance-implicit-cast-in-loop.rst @@ -1,7 +1,7 @@ performance-implicit-cast-in-loop ================================= -This warning appears in range-based loop with loop variable of const ref type +This warning appears in range-based loop with loop a variable of const ref type where the type of the variable does not match the one returned by the iterator. This means that an implicit cast has been added, which can for example result in expensive deep copies. Index: docs/clang-tidy/checks/readability-redundant-control-flow.rst =================================================================== --- docs/clang-tidy/checks/readability-redundant-control-flow.rst +++ docs/clang-tidy/checks/readability-redundant-control-flow.rst @@ -3,11 +3,12 @@ readability-redundant-control-flow ================================== -This check looks for procedures (functions returning no value) with `return` -statements at the end of the function. Such `return` statements are redundant. +This check looks for procedures (functions returning no value) with ``return`` +statements at the end of the function. Such ``return`` statements are +redundant. -Loop statements (`for`, `while`, `do while`) are checked for redundant -`continue` statements at the end of the loop body. +Loop statements (``for``, ``while``, ``do while``) are checked for redundant +``continue`` statements at the end of the loop body. Examples: