Index: clang-tools-extra/trunk/docs/ReleaseNotes.rst =================================================================== --- clang-tools-extra/trunk/docs/ReleaseNotes.rst +++ clang-tools-extra/trunk/docs/ReleaseNotes.rst @@ -63,14 +63,101 @@ 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 - selectively replaces string literals containing escaped characters with raw + 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-missing-comma + `_ check + + Warns about 'probably' missing comma in string literals initializer list. + +- 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 ``readability-avoid-const-params-in-decls`` check +- 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-avoid-const-params-in-decls + `_ check + + Warns about top-level const parameters in function declarations. + +- 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 running on compile database with relative source files paths. - warns about top-level const parameters in function declarations. + Crash when running with the `-fdelayed-template-parsing` flag. Clang-tidy changes from 3.7 to 3.8 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ Index: clang-tools-extra/trunk/docs/clang-tidy/checks/misc-dangling-handle.rst =================================================================== --- clang-tools-extra/trunk/docs/clang-tidy/checks/misc-dangling-handle.rst +++ clang-tools-extra/trunk/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: clang-tools-extra/trunk/docs/clang-tidy/checks/performance-faster-string-find.rst =================================================================== --- clang-tools-extra/trunk/docs/clang-tidy/checks/performance-faster-string-find.rst +++ clang-tools-extra/trunk/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: clang-tools-extra/trunk/docs/clang-tidy/checks/performance-implicit-cast-in-loop.rst =================================================================== --- clang-tools-extra/trunk/docs/clang-tidy/checks/performance-implicit-cast-in-loop.rst +++ clang-tools-extra/trunk/docs/clang-tidy/checks/performance-implicit-cast-in-loop.rst @@ -1,8 +1,9 @@ performance-implicit-cast-in-loop ================================= -This warning appears in range-based loop with loop variable of const ref type -where the type of the variable does not match the one returned by the iterator. +This warning appears in a 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. This means that an implicit cast has been added, which can for example result in expensive deep copies. Index: clang-tools-extra/trunk/docs/clang-tidy/checks/readability-redundant-control-flow.rst =================================================================== --- clang-tools-extra/trunk/docs/clang-tidy/checks/readability-redundant-control-flow.rst +++ clang-tools-extra/trunk/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: