[clang-tools-extra] r246169 - [clang-tidy] Update docs for clang-tidy checks. NFC
Alexander Kornienko via cfe-commits
cfe-commits at lists.llvm.org
Thu Aug 27 11:01:59 PDT 2015
Author: alexfh
Date: Thu Aug 27 13:01:58 2015
New Revision: 246169
URL: http://llvm.org/viewvc/llvm-project?rev=246169&view=rev
Log:
[clang-tidy] Update docs for clang-tidy checks. NFC
Changes mostly address formatting and unification of the style. Use
MarkDown style for inline code snippets and lists. Added some text
for a few checks.
The idea is to move most of the documentation out to separate rST files and have
implementation files refer to the corresponding documentation files.
Modified:
clang-tools-extra/trunk/clang-tidy/google/AvoidCStyleCastsCheck.h
clang-tools-extra/trunk/clang-tidy/google/ExplicitConstructorCheck.h
clang-tools-extra/trunk/clang-tidy/google/ExplicitMakePairCheck.h
clang-tools-extra/trunk/clang-tidy/google/IntegerTypesCheck.h
clang-tools-extra/trunk/clang-tidy/google/MemsetZeroLengthCheck.h
clang-tools-extra/trunk/clang-tidy/google/OverloadedUnaryAndCheck.h
clang-tools-extra/trunk/clang-tidy/google/StringReferenceMemberCheck.h
clang-tools-extra/trunk/clang-tidy/google/TodoCommentCheck.h
clang-tools-extra/trunk/clang-tidy/google/UnnamedNamespaceInHeaderCheck.h
clang-tools-extra/trunk/clang-tidy/google/UsingNamespaceDirectiveCheck.h
clang-tools-extra/trunk/clang-tidy/llvm/IncludeOrderCheck.h
clang-tools-extra/trunk/clang-tidy/llvm/TwineLocalCheck.h
clang-tools-extra/trunk/clang-tidy/misc/ArgumentCommentCheck.h
clang-tools-extra/trunk/clang-tidy/misc/AssertSideEffectCheck.h
clang-tools-extra/trunk/clang-tidy/misc/AssignOperatorSignatureCheck.h
clang-tools-extra/trunk/clang-tidy/misc/BoolPointerImplicitConversionCheck.h
clang-tools-extra/trunk/clang-tidy/misc/InaccurateEraseCheck.h
clang-tools-extra/trunk/clang-tidy/misc/InefficientAlgorithmCheck.h
clang-tools-extra/trunk/clang-tidy/misc/MacroParenthesesCheck.cpp
clang-tools-extra/trunk/clang-tidy/misc/MacroParenthesesCheck.h
clang-tools-extra/trunk/clang-tidy/misc/MacroRepeatedSideEffectsCheck.h
clang-tools-extra/trunk/clang-tidy/misc/MoveConstructorInitCheck.h
clang-tools-extra/trunk/clang-tidy/misc/NoexceptMoveConstructorCheck.h
clang-tools-extra/trunk/clang-tidy/misc/StaticAssertCheck.h
clang-tools-extra/trunk/clang-tidy/misc/SwappedArgumentsCheck.h
clang-tools-extra/trunk/clang-tidy/misc/UndelegatedConstructor.h
clang-tools-extra/trunk/clang-tidy/misc/UniqueptrResetReleaseCheck.h
clang-tools-extra/trunk/clang-tidy/misc/UnusedAliasDeclsCheck.h
clang-tools-extra/trunk/clang-tidy/misc/UnusedParametersCheck.h
clang-tools-extra/trunk/clang-tidy/misc/UnusedRAIICheck.h
clang-tools-extra/trunk/clang-tidy/misc/UseOverrideCheck.h
clang-tools-extra/trunk/clang-tidy/readability/BracesAroundStatementsCheck.h
clang-tools-extra/trunk/clang-tidy/readability/ContainerSizeEmptyCheck.h
clang-tools-extra/trunk/clang-tidy/readability/ElseAfterReturnCheck.h
clang-tools-extra/trunk/clang-tidy/readability/FunctionSizeCheck.h
clang-tools-extra/trunk/clang-tidy/readability/IdentifierNamingCheck.h
clang-tools-extra/trunk/clang-tidy/readability/NamedParameterCheck.h
clang-tools-extra/trunk/clang-tidy/readability/NamespaceCommentCheck.h
clang-tools-extra/trunk/clang-tidy/readability/RedundantSmartptrGetCheck.h
clang-tools-extra/trunk/clang-tidy/readability/RedundantStringCStrCheck.h
clang-tools-extra/trunk/clang-tidy/readability/ShrinkToFitCheck.h
clang-tools-extra/trunk/clang-tidy/readability/SimplifyBooleanExprCheck.h
clang-tools-extra/trunk/clang-tidy/utils/HeaderGuard.h
Modified: clang-tools-extra/trunk/clang-tidy/google/AvoidCStyleCastsCheck.h
URL: http://llvm.org/viewvc/llvm-project/clang-tools-extra/trunk/clang-tidy/google/AvoidCStyleCastsCheck.h?rev=246169&r1=246168&r2=246169&view=diff
==============================================================================
--- clang-tools-extra/trunk/clang-tidy/google/AvoidCStyleCastsCheck.h (original)
+++ clang-tools-extra/trunk/clang-tidy/google/AvoidCStyleCastsCheck.h Thu Aug 27 13:01:58 2015
@@ -17,14 +17,15 @@ namespace tidy {
namespace google {
namespace readability {
-/// \brief Finds usages of C-style casts.
+/// Finds usages of C-style casts.
///
/// http://google-styleguide.googlecode.com/svn/trunk/cppguide.xml?showone=Casting#Casting
+///
/// Corresponding cpplint.py check name: 'readability/casting'.
///
-/// This check is similar to -Wold-style-cast, but it will suggest automated
-/// fixes eventually. The reported locations should not be different from the
-/// ones generated by -Wold-style-cast.
+/// This check is similar to `-Wold-style-cast`, but it suggests automated fixes
+/// in some cases. The reported locations should not be different from the
+/// ones generated by `-Wold-style-cast`.
class AvoidCStyleCastsCheck : public ClangTidyCheck {
public:
AvoidCStyleCastsCheck(StringRef Name, ClangTidyContext *Context)
Modified: clang-tools-extra/trunk/clang-tidy/google/ExplicitConstructorCheck.h
URL: http://llvm.org/viewvc/llvm-project/clang-tools-extra/trunk/clang-tidy/google/ExplicitConstructorCheck.h?rev=246169&r1=246168&r2=246169&view=diff
==============================================================================
--- clang-tools-extra/trunk/clang-tidy/google/ExplicitConstructorCheck.h (original)
+++ clang-tools-extra/trunk/clang-tidy/google/ExplicitConstructorCheck.h Thu Aug 27 13:01:58 2015
@@ -16,10 +16,9 @@ namespace clang {
namespace tidy {
namespace google {
-/// \brief Checks that all single-argument constructors are explicit.
+/// Checks that all single-argument constructors are explicit.
///
-/// see:
-/// http://google-styleguide.googlecode.com/svn/trunk/cppguide.xml#Explicit_Constructors
+/// See http://google-styleguide.googlecode.com/svn/trunk/cppguide.xml#Explicit_Constructors
class ExplicitConstructorCheck : public ClangTidyCheck {
public:
ExplicitConstructorCheck(StringRef Name, ClangTidyContext *Context)
Modified: clang-tools-extra/trunk/clang-tidy/google/ExplicitMakePairCheck.h
URL: http://llvm.org/viewvc/llvm-project/clang-tools-extra/trunk/clang-tidy/google/ExplicitMakePairCheck.h?rev=246169&r1=246168&r2=246169&view=diff
==============================================================================
--- clang-tools-extra/trunk/clang-tidy/google/ExplicitMakePairCheck.h (original)
+++ clang-tools-extra/trunk/clang-tidy/google/ExplicitMakePairCheck.h Thu Aug 27 13:01:58 2015
@@ -17,9 +17,9 @@ namespace tidy {
namespace google {
namespace build {
-/// \brief Check that make_pair's template arguments are deduced.
+/// Check that `make_pair`'s template arguments are deduced.
///
-/// G++ 4.6 in C++11 mode fails badly if make_pair's template arguments are
+/// G++ 4.6 in C++11 mode fails badly if `make_pair`'s template arguments are
/// specified explicitly, and such use isn't intended in any case.
///
/// Corresponding cpplint.py check name: 'build/explicit_make_pair'.
Modified: clang-tools-extra/trunk/clang-tidy/google/IntegerTypesCheck.h
URL: http://llvm.org/viewvc/llvm-project/clang-tools-extra/trunk/clang-tidy/google/IntegerTypesCheck.h?rev=246169&r1=246168&r2=246169&view=diff
==============================================================================
--- clang-tools-extra/trunk/clang-tidy/google/IntegerTypesCheck.h (original)
+++ clang-tools-extra/trunk/clang-tidy/google/IntegerTypesCheck.h Thu Aug 27 13:01:58 2015
@@ -17,9 +17,10 @@ namespace tidy {
namespace google {
namespace runtime {
-/// \brief Finds uses of short, long and long long and suggest replacing them
-/// with u?intXX(_t)?.
-/// Correspondig cpplint.py check: runtime/int.
+/// Finds uses of `short`, `long` and `long long` and suggest replacing them
+/// with `u?intXX(_t)?`.
+///
+/// Correspondig cpplint.py check: 'runtime/int'.
class IntegerTypesCheck : public ClangTidyCheck {
public:
IntegerTypesCheck(StringRef Name, ClangTidyContext *Context)
Modified: clang-tools-extra/trunk/clang-tidy/google/MemsetZeroLengthCheck.h
URL: http://llvm.org/viewvc/llvm-project/clang-tools-extra/trunk/clang-tidy/google/MemsetZeroLengthCheck.h?rev=246169&r1=246168&r2=246169&view=diff
==============================================================================
--- clang-tools-extra/trunk/clang-tidy/google/MemsetZeroLengthCheck.h (original)
+++ clang-tools-extra/trunk/clang-tidy/google/MemsetZeroLengthCheck.h Thu Aug 27 13:01:58 2015
@@ -17,7 +17,7 @@ namespace tidy {
namespace google {
namespace runtime {
-/// \brief Finds calls to memset with a literal zero in the length argument.
+/// Finds calls to memset with a literal zero in the length argument.
///
/// This is most likely unintended and the length and value arguments are
/// swapped.
Modified: clang-tools-extra/trunk/clang-tidy/google/OverloadedUnaryAndCheck.h
URL: http://llvm.org/viewvc/llvm-project/clang-tools-extra/trunk/clang-tidy/google/OverloadedUnaryAndCheck.h?rev=246169&r1=246168&r2=246169&view=diff
==============================================================================
--- clang-tools-extra/trunk/clang-tidy/google/OverloadedUnaryAndCheck.h (original)
+++ clang-tools-extra/trunk/clang-tidy/google/OverloadedUnaryAndCheck.h Thu Aug 27 13:01:58 2015
@@ -17,9 +17,10 @@ namespace tidy {
namespace google {
namespace runtime {
-/// \brief Finds overloads of unary operator &.
+/// Finds overloads of unary `operator &`.
///
/// http://google-styleguide.googlecode.com/svn/trunk/cppguide.xml?showone=Operator_Overloading#Operator_Overloading
+///
/// Corresponding cpplint.py check name: 'runtime/operator'.
class OverloadedUnaryAndCheck : public ClangTidyCheck {
public:
Modified: clang-tools-extra/trunk/clang-tidy/google/StringReferenceMemberCheck.h
URL: http://llvm.org/viewvc/llvm-project/clang-tools-extra/trunk/clang-tidy/google/StringReferenceMemberCheck.h?rev=246169&r1=246168&r2=246169&view=diff
==============================================================================
--- clang-tools-extra/trunk/clang-tidy/google/StringReferenceMemberCheck.h (original)
+++ clang-tools-extra/trunk/clang-tidy/google/StringReferenceMemberCheck.h Thu Aug 27 13:01:58 2015
@@ -17,25 +17,25 @@ namespace tidy {
namespace google {
namespace runtime {
-/// \brief Finds members of type 'const string&'.
+/// Finds members of type `const string&`.
///
/// const string reference members are generally considered unsafe as they can
/// be created from a temporary quite easily.
///
/// \code
-/// struct S {
-/// S(const string &Str) : Str(Str) {}
-/// const string &Str;
-/// };
-/// S instance("string");
+/// struct S {
+/// S(const string &Str) : Str(Str) {}
+/// const string &Str;
+/// };
+/// S instance("string");
/// \endcode
///
-/// In the constructor call a string temporary is created from const char * and
-/// destroyed immediately after the call. This leaves around a dangling
+/// In the constructor call a string temporary is created from `const char *`
+/// and destroyed immediately after the call. This leaves around a dangling
/// reference.
///
-/// This check emit warnings for both std::string and ::string const reference
-/// members.
+/// This check emit warnings for both `std::string` and `::string` const
+/// reference members.
///
/// Corresponding cpplint.py check name: 'runtime/member_string_reference'.
class StringReferenceMemberCheck : public ClangTidyCheck {
Modified: clang-tools-extra/trunk/clang-tidy/google/TodoCommentCheck.h
URL: http://llvm.org/viewvc/llvm-project/clang-tools-extra/trunk/clang-tidy/google/TodoCommentCheck.h?rev=246169&r1=246168&r2=246169&view=diff
==============================================================================
--- clang-tools-extra/trunk/clang-tidy/google/TodoCommentCheck.h (original)
+++ clang-tools-extra/trunk/clang-tidy/google/TodoCommentCheck.h Thu Aug 27 13:01:58 2015
@@ -17,9 +17,9 @@ namespace tidy {
namespace google {
namespace readability {
-/// \brief Finds TODO comments without a username or bug number.
+/// Finds TODO comments without a username or bug number.
///
-/// Corresponding cpplint.py check: readability/todo
+/// Corresponding cpplint.py check: 'readability/todo'
class TodoCommentCheck : public ClangTidyCheck {
public:
TodoCommentCheck(StringRef Name, ClangTidyContext *Context);
Modified: clang-tools-extra/trunk/clang-tidy/google/UnnamedNamespaceInHeaderCheck.h
URL: http://llvm.org/viewvc/llvm-project/clang-tools-extra/trunk/clang-tidy/google/UnnamedNamespaceInHeaderCheck.h?rev=246169&r1=246168&r2=246169&view=diff
==============================================================================
--- clang-tools-extra/trunk/clang-tidy/google/UnnamedNamespaceInHeaderCheck.h (original)
+++ clang-tools-extra/trunk/clang-tidy/google/UnnamedNamespaceInHeaderCheck.h Thu Aug 27 13:01:58 2015
@@ -17,9 +17,10 @@ namespace tidy {
namespace google {
namespace build {
-/// \brief Finds anonymous namespaces in headers.
+/// Finds anonymous namespaces in headers.
///
/// http://google-styleguide.googlecode.com/svn/trunk/cppguide.xml?showone=Namespaces#Namespaces
+///
/// Corresponding cpplint.py check name: 'build/namespaces'.
class UnnamedNamespaceInHeaderCheck : public ClangTidyCheck {
public:
Modified: clang-tools-extra/trunk/clang-tidy/google/UsingNamespaceDirectiveCheck.h
URL: http://llvm.org/viewvc/llvm-project/clang-tools-extra/trunk/clang-tidy/google/UsingNamespaceDirectiveCheck.h?rev=246169&r1=246168&r2=246169&view=diff
==============================================================================
--- clang-tools-extra/trunk/clang-tidy/google/UsingNamespaceDirectiveCheck.h (original)
+++ clang-tools-extra/trunk/clang-tidy/google/UsingNamespaceDirectiveCheck.h Thu Aug 27 13:01:58 2015
@@ -17,10 +17,21 @@ namespace tidy {
namespace google {
namespace build {
-/// \brief Finds using namespace directives.
+/// Finds using namespace directives.
///
/// http://google-styleguide.googlecode.com/svn/trunk/cppguide.xml?showone=Namespaces#Namespaces
-/// Corresponding cpplint.py check name: 'build/namespaces'.
+///
+/// The check implements the following rule of the Google C++ Style Guide:
+///
+/// You may not use a using-directive to make all names from a namespace
+/// available.
+///
+/// \code
+/// // Forbidden -- This pollutes the namespace.
+/// using namespace foo;
+/// \endcode
+///
+/// Corresponding cpplint.py check name: `build/namespaces`.
class UsingNamespaceDirectiveCheck : public ClangTidyCheck {
public:
UsingNamespaceDirectiveCheck(StringRef Name, ClangTidyContext *Context)
Modified: clang-tools-extra/trunk/clang-tidy/llvm/IncludeOrderCheck.h
URL: http://llvm.org/viewvc/llvm-project/clang-tools-extra/trunk/clang-tidy/llvm/IncludeOrderCheck.h?rev=246169&r1=246168&r2=246169&view=diff
==============================================================================
--- clang-tools-extra/trunk/clang-tidy/llvm/IncludeOrderCheck.h (original)
+++ clang-tools-extra/trunk/clang-tidy/llvm/IncludeOrderCheck.h Thu Aug 27 13:01:58 2015
@@ -16,9 +16,9 @@ namespace clang {
namespace tidy {
namespace llvm {
-/// \brief Checks the correct order of \c #includes.
+/// Checks the correct order of `#includes`.
///
-/// see: http://llvm.org/docs/CodingStandards.html#include-style
+/// See http://llvm.org/docs/CodingStandards.html#include-style
class IncludeOrderCheck : public ClangTidyCheck {
public:
IncludeOrderCheck(StringRef Name, ClangTidyContext *Context)
Modified: clang-tools-extra/trunk/clang-tidy/llvm/TwineLocalCheck.h
URL: http://llvm.org/viewvc/llvm-project/clang-tools-extra/trunk/clang-tidy/llvm/TwineLocalCheck.h?rev=246169&r1=246168&r2=246169&view=diff
==============================================================================
--- clang-tools-extra/trunk/clang-tidy/llvm/TwineLocalCheck.h (original)
+++ clang-tools-extra/trunk/clang-tidy/llvm/TwineLocalCheck.h Thu Aug 27 13:01:58 2015
@@ -16,8 +16,8 @@ namespace clang {
namespace tidy {
namespace llvm {
-/// \brief Looks for local Twine variables which are prone to use after frees
-/// and should be generally avoided.
+/// Looks for local `Twine` variables which are prone to use after frees and
+/// should be generally avoided.
class TwineLocalCheck : public ClangTidyCheck {
public:
TwineLocalCheck(StringRef Name, ClangTidyContext *Context)
Modified: clang-tools-extra/trunk/clang-tidy/misc/ArgumentCommentCheck.h
URL: http://llvm.org/viewvc/llvm-project/clang-tools-extra/trunk/clang-tidy/misc/ArgumentCommentCheck.h?rev=246169&r1=246168&r2=246169&view=diff
==============================================================================
--- clang-tools-extra/trunk/clang-tidy/misc/ArgumentCommentCheck.h (original)
+++ clang-tools-extra/trunk/clang-tidy/misc/ArgumentCommentCheck.h Thu Aug 27 13:01:58 2015
@@ -17,7 +17,20 @@ namespace clang {
namespace tidy {
namespace misc {
-/// \brief Checks that argument comments match parameter names.
+/// Checks that argument comments match parameter names.
+///
+/// The check understands argument comments in the form `/*parameter_name=*/`
+/// that are placed right before the argument.
+///
+/// \code
+/// void f(bool foo);
+///
+/// ...
+/// f(/*bar=*/true);
+/// // warning: argument name 'bar' in comment does not match parameter name 'foo'
+/// \endcode
+///
+/// The check tries to detect typos and suggest automated fixes for them.
class ArgumentCommentCheck : public ClangTidyCheck {
public:
ArgumentCommentCheck(StringRef Name, ClangTidyContext *Context);
Modified: clang-tools-extra/trunk/clang-tidy/misc/AssertSideEffectCheck.h
URL: http://llvm.org/viewvc/llvm-project/clang-tools-extra/trunk/clang-tidy/misc/AssertSideEffectCheck.h?rev=246169&r1=246168&r2=246169&view=diff
==============================================================================
--- clang-tools-extra/trunk/clang-tidy/misc/AssertSideEffectCheck.h (original)
+++ clang-tools-extra/trunk/clang-tidy/misc/AssertSideEffectCheck.h Thu Aug 27 13:01:58 2015
@@ -18,19 +18,19 @@
namespace clang {
namespace tidy {
-/// \brief Finds \c assert() with side effect.
+/// Finds `assert()` with side effect.
///
-/// The condition of \c assert() is evaluated only in debug builds so a
+/// The condition of `assert()` is evaluated only in debug builds so a
/// condition with side effect can cause different behavior in debug / release
/// builds.
///
/// There are two options:
-/// - AssertMacros: A comma-separated list of the names of assert macros to be
-/// checked.
-/// - CheckFunctionCalls: Whether to treat non-const member and non-member
-/// functions as they produce side effects. Disabled by default because it can
-/// increase the number of false positive warnings.
-
+///
+/// - `AssertMacros`: A comma-separated list of the names of assert macros to
+/// be checked.
+/// - `CheckFunctionCalls`: Whether to treat non-const member and non-member
+/// functions as they produce side effects. Disabled by default because it
+/// can increase the number of false positive warnings.
class AssertSideEffectCheck : public ClangTidyCheck {
public:
AssertSideEffectCheck(StringRef Name, ClangTidyContext *Context);
Modified: clang-tools-extra/trunk/clang-tidy/misc/AssignOperatorSignatureCheck.h
URL: http://llvm.org/viewvc/llvm-project/clang-tools-extra/trunk/clang-tidy/misc/AssignOperatorSignatureCheck.h?rev=246169&r1=246168&r2=246169&view=diff
==============================================================================
--- clang-tools-extra/trunk/clang-tidy/misc/AssignOperatorSignatureCheck.h (original)
+++ clang-tools-extra/trunk/clang-tidy/misc/AssignOperatorSignatureCheck.h Thu Aug 27 13:01:58 2015
@@ -16,12 +16,12 @@ namespace clang {
namespace tidy {
namespace misc {
-/// \brief Finds declarations of assign operators with the wrong return and/or
-/// argument types.
+/// Finds declarations of assign operators with the wrong return and/or argument
+/// types.
///
-/// The return type must be \c Class&.
-/// Works with move-assign and assign by value.
-/// Private and deleted operators are ignored.
+/// * The return type must be `Class&`.
+/// * Works with move-assign and assign by value.
+/// * Private and deleted operators are ignored.
class AssignOperatorSignatureCheck : public ClangTidyCheck {
public:
AssignOperatorSignatureCheck(StringRef Name, ClangTidyContext *Context)
Modified: clang-tools-extra/trunk/clang-tidy/misc/BoolPointerImplicitConversionCheck.h
URL: http://llvm.org/viewvc/llvm-project/clang-tools-extra/trunk/clang-tidy/misc/BoolPointerImplicitConversionCheck.h?rev=246169&r1=246168&r2=246169&view=diff
==============================================================================
--- clang-tools-extra/trunk/clang-tidy/misc/BoolPointerImplicitConversionCheck.h (original)
+++ clang-tools-extra/trunk/clang-tidy/misc/BoolPointerImplicitConversionCheck.h Thu Aug 27 13:01:58 2015
@@ -16,12 +16,17 @@ namespace clang {
namespace tidy {
namespace misc {
-/// \brief Checks for conditions based on implicit conversion from a bool
-/// pointer to bool e.g.
-/// bool *p;
-/// if (p) {
-/// // Never used in a pointer-specific way.
-/// }
+/// Checks for conditions based on implicit conversion from a bool pointer to
+/// bool.
+///
+/// Example:
+///
+/// \code
+/// bool *p;
+/// if (p) {
+/// // Never used in a pointer-specific way.
+/// }
+/// \endcode
class BoolPointerImplicitConversionCheck : public ClangTidyCheck {
public:
BoolPointerImplicitConversionCheck(StringRef Name, ClangTidyContext *Context)
Modified: clang-tools-extra/trunk/clang-tidy/misc/InaccurateEraseCheck.h
URL: http://llvm.org/viewvc/llvm-project/clang-tools-extra/trunk/clang-tidy/misc/InaccurateEraseCheck.h?rev=246169&r1=246168&r2=246169&view=diff
==============================================================================
--- clang-tools-extra/trunk/clang-tidy/misc/InaccurateEraseCheck.h (original)
+++ clang-tools-extra/trunk/clang-tidy/misc/InaccurateEraseCheck.h Thu Aug 27 13:01:58 2015
@@ -16,12 +16,12 @@ namespace clang {
namespace tidy {
namespace misc {
-/// \brief Checks for inaccurate use of \c erase() method.
+/// Checks for inaccurate use of the `erase()` method.
///
-/// Algorithms like \c remove() do not actually remove any element from the
+/// Algorithms like `remove()` do not actually remove any element from the
/// container but return an iterator to the first redundant element at the end
/// of the container. These redundant elements must be removed using the
-/// \c erase() method. This check warns when not all of the elements will be
+/// `erase()` method. This check warns when not all of the elements will be
/// removed due to using an inappropriate overload.
class InaccurateEraseCheck : public ClangTidyCheck {
public:
Modified: clang-tools-extra/trunk/clang-tidy/misc/InefficientAlgorithmCheck.h
URL: http://llvm.org/viewvc/llvm-project/clang-tools-extra/trunk/clang-tidy/misc/InefficientAlgorithmCheck.h?rev=246169&r1=246168&r2=246169&view=diff
==============================================================================
--- clang-tools-extra/trunk/clang-tidy/misc/InefficientAlgorithmCheck.h (original)
+++ clang-tools-extra/trunk/clang-tidy/misc/InefficientAlgorithmCheck.h Thu Aug 27 13:01:58 2015
@@ -16,7 +16,7 @@ namespace clang {
namespace tidy {
namespace misc {
-/// \brief Warns on inefficient use of STL algorithms on associative containers.
+/// Warns on inefficient use of STL algorithms on associative containers.
///
/// Associative containers implements some of the algorithms as methods which
/// should be preferred to the algorithms in the algorithm header. The methods
Modified: clang-tools-extra/trunk/clang-tidy/misc/MacroParenthesesCheck.cpp
URL: http://llvm.org/viewvc/llvm-project/clang-tools-extra/trunk/clang-tidy/misc/MacroParenthesesCheck.cpp?rev=246169&r1=246168&r2=246169&view=diff
==============================================================================
--- clang-tools-extra/trunk/clang-tidy/misc/MacroParenthesesCheck.cpp (original)
+++ clang-tools-extra/trunk/clang-tidy/misc/MacroParenthesesCheck.cpp Thu Aug 27 13:01:58 2015
@@ -54,14 +54,14 @@ static bool isSurroundedRight(const Toke
/// Is given TokenKind a keyword?
static bool isKeyword(const Token &T) {
- /// \TODO better matching of keywords to avoid false positives
+ // FIXME: better matching of keywords to avoid false positives.
return T.isOneOf(tok::kw_case, tok::kw_const, tok::kw_struct);
}
/// Warning is written when one of these operators are not within parentheses.
static bool isWarnOp(const Token &T) {
- /// \TODO This is an initial list of operators. It can be tweaked later to
- /// get more positives or perhaps avoid some false positive.
+ // FIXME: This is an initial list of operators. It can be tweaked later to
+ // get more positives or perhaps avoid some false positive.
return T.isOneOf(tok::plus, tok::minus, tok::star, tok::slash, tok::percent,
tok::amp, tok::pipe, tok::caret);
}
Modified: clang-tools-extra/trunk/clang-tidy/misc/MacroParenthesesCheck.h
URL: http://llvm.org/viewvc/llvm-project/clang-tools-extra/trunk/clang-tidy/misc/MacroParenthesesCheck.h?rev=246169&r1=246168&r2=246169&view=diff
==============================================================================
--- clang-tools-extra/trunk/clang-tidy/misc/MacroParenthesesCheck.h (original)
+++ clang-tools-extra/trunk/clang-tidy/misc/MacroParenthesesCheck.h Thu Aug 27 13:01:58 2015
@@ -15,8 +15,7 @@
namespace clang {
namespace tidy {
-/// \brief Finds macros that can have unexpected behaviour due to missing
-/// parentheses.
+/// Finds macros that can have unexpected behaviour due to missing parentheses.
///
/// Macros are expanded by the preprocessor as-is. As a result, there can be
/// unexpected behaviour; operators may be evaluated in unexpected order and
Modified: clang-tools-extra/trunk/clang-tidy/misc/MacroRepeatedSideEffectsCheck.h
URL: http://llvm.org/viewvc/llvm-project/clang-tools-extra/trunk/clang-tidy/misc/MacroRepeatedSideEffectsCheck.h?rev=246169&r1=246168&r2=246169&view=diff
==============================================================================
--- clang-tools-extra/trunk/clang-tidy/misc/MacroRepeatedSideEffectsCheck.h (original)
+++ clang-tools-extra/trunk/clang-tidy/misc/MacroRepeatedSideEffectsCheck.h Thu Aug 27 13:01:58 2015
@@ -16,8 +16,7 @@ namespace clang {
namespace tidy {
namespace misc {
-/// \brief Checks for repeated argument with side effects in macros.
-///
+/// Checks for repeated argument with side effects in macros.
class MacroRepeatedSideEffectsCheck : public ClangTidyCheck {
public:
MacroRepeatedSideEffectsCheck(StringRef Name, ClangTidyContext *Context)
Modified: clang-tools-extra/trunk/clang-tidy/misc/MoveConstructorInitCheck.h
URL: http://llvm.org/viewvc/llvm-project/clang-tools-extra/trunk/clang-tidy/misc/MoveConstructorInitCheck.h?rev=246169&r1=246168&r2=246169&view=diff
==============================================================================
--- clang-tools-extra/trunk/clang-tidy/misc/MoveConstructorInitCheck.h (original)
+++ clang-tools-extra/trunk/clang-tidy/misc/MoveConstructorInitCheck.h Thu Aug 27 13:01:58 2015
@@ -15,9 +15,9 @@
namespace clang {
namespace tidy {
-/// \brief The check flags user-defined move constructors that have a
-/// ctor-initializer initializing a member or base class through a copy
-/// constructor instead of a move constructor.
+/// The check flags user-defined move constructors that have a ctor-initializer
+/// initializing a member or base class through a copy constructor instead of a
+/// move constructor.
class MoveConstructorInitCheck : public ClangTidyCheck {
public:
MoveConstructorInitCheck(StringRef Name, ClangTidyContext *Context)
Modified: clang-tools-extra/trunk/clang-tidy/misc/NoexceptMoveConstructorCheck.h
URL: http://llvm.org/viewvc/llvm-project/clang-tools-extra/trunk/clang-tidy/misc/NoexceptMoveConstructorCheck.h?rev=246169&r1=246168&r2=246169&view=diff
==============================================================================
--- clang-tools-extra/trunk/clang-tidy/misc/NoexceptMoveConstructorCheck.h (original)
+++ clang-tools-extra/trunk/clang-tidy/misc/NoexceptMoveConstructorCheck.h Thu Aug 27 13:01:58 2015
@@ -15,12 +15,12 @@
namespace clang {
namespace tidy {
-/// \brief The check flags user-defined move constructors and assignment
-/// operators not marked with \c noexcept or marked with \c noexcept(expr) where
-/// \c expr evaluates to \c false (but is not a \c false literal itself).
+/// The check flags user-defined move constructors and assignment operators not
+/// marked with `noexcept` or marked with `noexcept(expr)` where `expr`
+/// evaluates to `false` (but is not a `false` literal itself).
///
/// Move constructors of all the types used with STL containers, for example,
-/// need to be declared \c noexcept. Otherwise STL will choose copy constructors
+/// need to be declared `noexcept`. Otherwise STL will choose copy constructors
/// instead. The same is valid for move assignment operations.
class NoexceptMoveConstructorCheck : public ClangTidyCheck {
public:
Modified: clang-tools-extra/trunk/clang-tidy/misc/StaticAssertCheck.h
URL: http://llvm.org/viewvc/llvm-project/clang-tools-extra/trunk/clang-tidy/misc/StaticAssertCheck.h?rev=246169&r1=246168&r2=246169&view=diff
==============================================================================
--- clang-tools-extra/trunk/clang-tidy/misc/StaticAssertCheck.h (original)
+++ clang-tools-extra/trunk/clang-tidy/misc/StaticAssertCheck.h Thu Aug 27 13:01:58 2015
@@ -17,10 +17,10 @@
namespace clang {
namespace tidy {
-/// \brief Replaces \c assert() with \c static_assert() if the condition is
-/// evaluatable at compile time.
+/// Replaces `assert()` with `static_assert()` if the condition is evaluatable
+/// at compile time.
///
-/// The condition of \c static_assert() is evaluated at compile time which is
+/// The condition of `static_assert()` is evaluated at compile time which is
/// safer and more efficient.
class StaticAssertCheck : public ClangTidyCheck {
public:
Modified: clang-tools-extra/trunk/clang-tidy/misc/SwappedArgumentsCheck.h
URL: http://llvm.org/viewvc/llvm-project/clang-tools-extra/trunk/clang-tidy/misc/SwappedArgumentsCheck.h?rev=246169&r1=246168&r2=246169&view=diff
==============================================================================
--- clang-tools-extra/trunk/clang-tidy/misc/SwappedArgumentsCheck.h (original)
+++ clang-tools-extra/trunk/clang-tidy/misc/SwappedArgumentsCheck.h Thu Aug 27 13:01:58 2015
@@ -16,8 +16,7 @@ namespace clang {
namespace tidy {
namespace misc {
-/// \brief Finds potentially swapped arguments by looking at implicit
-/// conversions.
+/// Finds potentially swapped arguments by looking at implicit conversions.
class SwappedArgumentsCheck : public ClangTidyCheck {
public:
SwappedArgumentsCheck(StringRef Name, ClangTidyContext *Context)
Modified: clang-tools-extra/trunk/clang-tidy/misc/UndelegatedConstructor.h
URL: http://llvm.org/viewvc/llvm-project/clang-tools-extra/trunk/clang-tidy/misc/UndelegatedConstructor.h?rev=246169&r1=246168&r2=246169&view=diff
==============================================================================
--- clang-tools-extra/trunk/clang-tidy/misc/UndelegatedConstructor.h (original)
+++ clang-tools-extra/trunk/clang-tidy/misc/UndelegatedConstructor.h Thu Aug 27 13:01:58 2015
@@ -16,9 +16,11 @@ namespace clang {
namespace tidy {
namespace misc {
-/// \brief Finds creation of temporary objects in constructors that look like a
-/// function call to another constructor of the same class. The user most likely
-/// meant to use a delegating constructor or base class initializer.
+/// Finds creation of temporary objects in constructors that look like a
+/// function call to another constructor of the same class.
+///
+/// The user most likely meant to use a delegating constructor or base class
+/// initializer.
class UndelegatedConstructorCheck : public ClangTidyCheck {
public:
UndelegatedConstructorCheck(StringRef Name, ClangTidyContext *Context)
Modified: clang-tools-extra/trunk/clang-tidy/misc/UniqueptrResetReleaseCheck.h
URL: http://llvm.org/viewvc/llvm-project/clang-tools-extra/trunk/clang-tidy/misc/UniqueptrResetReleaseCheck.h?rev=246169&r1=246168&r2=246169&view=diff
==============================================================================
--- clang-tools-extra/trunk/clang-tidy/misc/UniqueptrResetReleaseCheck.h (original)
+++ clang-tools-extra/trunk/clang-tidy/misc/UniqueptrResetReleaseCheck.h Thu Aug 27 13:01:58 2015
@@ -16,14 +16,17 @@ namespace clang {
namespace tidy {
namespace misc {
-/// \brief Find and replace unique_ptr::reset(release()) with std::move
+/// Find and replace `unique_ptr::reset(release())` with `std::move()`.
///
/// Example:
+///
+/// \code
/// std::unique_ptr<Foo> x, y;
/// x.reset(y.release()); -> x = std::move(y);
+/// \endcode
///
-/// If "y" is already rvalue, std::move is not added.
-/// "x" and "y" can also be std::unique_ptr<Foo>*.
+/// If `y` is already rvalue, `std::move()` is not added. `x` and `y` can also
+/// be `std::unique_ptr<Foo>*`.
class UniqueptrResetReleaseCheck : public ClangTidyCheck {
public:
UniqueptrResetReleaseCheck(StringRef Name, ClangTidyContext *Context)
Modified: clang-tools-extra/trunk/clang-tidy/misc/UnusedAliasDeclsCheck.h
URL: http://llvm.org/viewvc/llvm-project/clang-tools-extra/trunk/clang-tidy/misc/UnusedAliasDeclsCheck.h?rev=246169&r1=246168&r2=246169&view=diff
==============================================================================
--- clang-tools-extra/trunk/clang-tidy/misc/UnusedAliasDeclsCheck.h (original)
+++ clang-tools-extra/trunk/clang-tidy/misc/UnusedAliasDeclsCheck.h Thu Aug 27 13:01:58 2015
@@ -15,7 +15,7 @@
namespace clang {
namespace tidy {
-/// \brief Finds unused namespace alias declarations.
+/// Finds unused namespace alias declarations.
class UnusedAliasDeclsCheck : public ClangTidyCheck {
public:
UnusedAliasDeclsCheck(StringRef Name, ClangTidyContext *Context)
Modified: clang-tools-extra/trunk/clang-tidy/misc/UnusedParametersCheck.h
URL: http://llvm.org/viewvc/llvm-project/clang-tools-extra/trunk/clang-tidy/misc/UnusedParametersCheck.h?rev=246169&r1=246168&r2=246169&view=diff
==============================================================================
--- clang-tools-extra/trunk/clang-tidy/misc/UnusedParametersCheck.h (original)
+++ clang-tools-extra/trunk/clang-tidy/misc/UnusedParametersCheck.h Thu Aug 27 13:01:58 2015
@@ -15,8 +15,8 @@
namespace clang {
namespace tidy {
-/// \brief Finds unused parameters and fixes them, so that -Wunused-parameter
-/// can be turned on.
+/// Finds unused parameters and fixes them, so that `-Wunused-parameter` can be
+/// turned on.
class UnusedParametersCheck : public ClangTidyCheck {
public:
UnusedParametersCheck(StringRef Name, ClangTidyContext *Context)
Modified: clang-tools-extra/trunk/clang-tidy/misc/UnusedRAIICheck.h
URL: http://llvm.org/viewvc/llvm-project/clang-tools-extra/trunk/clang-tidy/misc/UnusedRAIICheck.h?rev=246169&r1=246168&r2=246169&view=diff
==============================================================================
--- clang-tools-extra/trunk/clang-tidy/misc/UnusedRAIICheck.h (original)
+++ clang-tools-extra/trunk/clang-tidy/misc/UnusedRAIICheck.h Thu Aug 27 13:01:58 2015
@@ -16,26 +16,30 @@ namespace clang {
namespace tidy {
namespace misc {
-/// \brief Finds temporaries that look like RAII objects.
+/// Finds temporaries that look like RAII objects.
///
/// The canonical example for this is a scoped lock.
+///
/// \code
/// {
/// scoped_lock(&global_mutex);
/// critical_section();
/// }
/// \endcode
-/// The destructor of the scoped_lock is called before the critical_section is
+///
+/// The destructor of the scoped_lock is called before the `critical_section` is
/// entered, leaving it unprotected.
///
/// We apply a number of heuristics to reduce the false positive count of this
/// check:
-/// - Ignore code expanded from macros. Testing frameworks make heavy use of
+///
+/// * Ignore code expanded from macros. Testing frameworks make heavy use of
/// this.
-/// - Ignore types with no user-declared constructor. Those are very unlikely
+/// * Ignore types with no user-declared constructor. Those are very unlikely
/// to be RAII objects.
-/// - Ignore objects at the end of a compound statement (doesn't change behavior).
-/// - Ignore objects returned from a call.
+/// * Ignore objects at the end of a compound statement (doesn't change
+/// behavior).
+/// * Ignore objects returned from a call.
class UnusedRAIICheck : public ClangTidyCheck {
public:
UnusedRAIICheck(StringRef Name, ClangTidyContext *Context)
Modified: clang-tools-extra/trunk/clang-tidy/misc/UseOverrideCheck.h
URL: http://llvm.org/viewvc/llvm-project/clang-tools-extra/trunk/clang-tidy/misc/UseOverrideCheck.h?rev=246169&r1=246168&r2=246169&view=diff
==============================================================================
--- clang-tools-extra/trunk/clang-tidy/misc/UseOverrideCheck.h (original)
+++ clang-tools-extra/trunk/clang-tidy/misc/UseOverrideCheck.h Thu Aug 27 13:01:58 2015
@@ -16,7 +16,7 @@ namespace clang {
namespace tidy {
namespace misc {
-/// \brief Use C++11's 'override' and remove 'virtual' where applicable.
+/// Use C++11's `override` and remove `virtual` where applicable.
class UseOverrideCheck : public ClangTidyCheck {
public:
UseOverrideCheck(StringRef Name, ClangTidyContext *Context)
Modified: clang-tools-extra/trunk/clang-tidy/readability/BracesAroundStatementsCheck.h
URL: http://llvm.org/viewvc/llvm-project/clang-tools-extra/trunk/clang-tidy/readability/BracesAroundStatementsCheck.h?rev=246169&r1=246168&r2=246169&view=diff
==============================================================================
--- clang-tools-extra/trunk/clang-tidy/readability/BracesAroundStatementsCheck.h (original)
+++ clang-tools-extra/trunk/clang-tidy/readability/BracesAroundStatementsCheck.h Thu Aug 27 13:01:58 2015
@@ -16,25 +16,31 @@ namespace clang {
namespace tidy {
namespace readability {
-/// \brief Checks that bodies of 'if' statements and loops ('for', 'range-for',
-/// 'do-while', and 'while') are inside braces
+/// Checks that bodies of `if` statements and loops (`for`, `range-for`,
+/// `do-while`, and `while`) are inside braces
///
/// Before:
-/// if (condition)
-/// statement;
+///
+/// \code
+/// if (condition)
+/// statement;
+/// \endcode
///
/// After:
-/// if (condition) {
-/// statement;
-/// }
+///
+/// \code
+/// if (condition) {
+/// statement;
+/// }
+/// \endcode
///
/// Additionally, one can define an option `ShortStatementLines` defining the
/// minimal number of lines that the statement should have in order to trigger
/// this check.
+///
/// The number of lines is counted from the end of condition or initial keyword
-/// (do/else) until the last line of the inner statement.
-/// Default value 0 means that braces will be added to all statements (not
-/// having them already).
+/// (`do`/`else`) until the last line of the inner statement. Default value 0
+/// means that braces will be added to all statements (not having them already).
class BracesAroundStatementsCheck : public ClangTidyCheck {
public:
BracesAroundStatementsCheck(StringRef Name, ClangTidyContext *Context);
Modified: clang-tools-extra/trunk/clang-tidy/readability/ContainerSizeEmptyCheck.h
URL: http://llvm.org/viewvc/llvm-project/clang-tools-extra/trunk/clang-tidy/readability/ContainerSizeEmptyCheck.h?rev=246169&r1=246168&r2=246169&view=diff
==============================================================================
--- clang-tools-extra/trunk/clang-tidy/readability/ContainerSizeEmptyCheck.h (original)
+++ clang-tools-extra/trunk/clang-tidy/readability/ContainerSizeEmptyCheck.h Thu Aug 27 13:01:58 2015
@@ -16,16 +16,16 @@ namespace clang {
namespace tidy {
namespace readability {
-/// \brief Checks whether a call to the \c size() method can be replaced with a
-/// call to \c empty().
+/// Checks whether a call to the `size()` method can be replaced with a call to
+/// `empty()`.
///
-/// The emptiness of a container should be checked using the \c empty() method
-/// instead of the \c size() method. It is not guaranteed that \c size() is a
+/// The emptiness of a container should be checked using the `empty()` method
+/// instead of the `size()` method. It is not guaranteed that `size()` is a
/// constant-time function, and it is generally more efficient and also shows
-/// clearer intent to use \c empty(). Furthermore some containers may implement
-/// the \c empty() method but not implement the \c size() method. Using \c
-/// empty() whenever possible makes it easier to switch to another container in
-/// the future.
+/// clearer intent to use `empty()`. Furthermore some containers may implement
+/// the `empty()` method but not implement the `size()` method. Using `empty()`
+/// whenever possible makes it easier to switch to another container in the
+/// future.
class ContainerSizeEmptyCheck : public ClangTidyCheck {
public:
ContainerSizeEmptyCheck(StringRef Name, ClangTidyContext *Context);
Modified: clang-tools-extra/trunk/clang-tidy/readability/ElseAfterReturnCheck.h
URL: http://llvm.org/viewvc/llvm-project/clang-tools-extra/trunk/clang-tidy/readability/ElseAfterReturnCheck.h?rev=246169&r1=246168&r2=246169&view=diff
==============================================================================
--- clang-tools-extra/trunk/clang-tidy/readability/ElseAfterReturnCheck.h (original)
+++ clang-tools-extra/trunk/clang-tidy/readability/ElseAfterReturnCheck.h Thu Aug 27 13:01:58 2015
@@ -16,6 +16,9 @@ namespace clang {
namespace tidy {
namespace readability {
+/// Flags the usages of `else` after `return`.
+///
+/// http://llvm.org/docs/CodingStandards.html#don-t-use-else-after-a-return
class ElseAfterReturnCheck : public ClangTidyCheck {
public:
ElseAfterReturnCheck(StringRef Name, ClangTidyContext *Context)
Modified: clang-tools-extra/trunk/clang-tidy/readability/FunctionSizeCheck.h
URL: http://llvm.org/viewvc/llvm-project/clang-tools-extra/trunk/clang-tidy/readability/FunctionSizeCheck.h?rev=246169&r1=246168&r2=246169&view=diff
==============================================================================
--- clang-tools-extra/trunk/clang-tidy/readability/FunctionSizeCheck.h (original)
+++ clang-tools-extra/trunk/clang-tidy/readability/FunctionSizeCheck.h Thu Aug 27 13:01:58 2015
@@ -16,7 +16,17 @@ namespace clang {
namespace tidy {
namespace readability {
-/// \brief Checks for large functions based on various metrics.
+/// Checks for large functions based on various metrics.
+///
+/// These options are supported:
+///
+/// * `LineThreshold` - flag functions exceeding this number of lines. The
+/// default is `-1` (ignore the number of lines).
+/// * `StatementThreshold` - flag functions exceeding this number of
+/// statements. This may differ significantly from the number of lines for
+/// macro-heavy code. The default is `800`.
+/// * `BranchThreshold` - flag functions exceeding this number of control
+/// statements. The default is `-1` (ignore the number of branches).
class FunctionSizeCheck : public ClangTidyCheck {
public:
FunctionSizeCheck(StringRef Name, ClangTidyContext *Context);
Modified: clang-tools-extra/trunk/clang-tidy/readability/IdentifierNamingCheck.h
URL: http://llvm.org/viewvc/llvm-project/clang-tools-extra/trunk/clang-tidy/readability/IdentifierNamingCheck.h?rev=246169&r1=246168&r2=246169&view=diff
==============================================================================
--- clang-tools-extra/trunk/clang-tidy/readability/IdentifierNamingCheck.h (original)
+++ clang-tools-extra/trunk/clang-tidy/readability/IdentifierNamingCheck.h Thu Aug 27 13:01:58 2015
@@ -16,7 +16,19 @@ namespace clang {
namespace tidy {
namespace readability {
-/// \brief Checks for identifiers naming style mismatch.
+/// Checks for identifiers naming style mismatch.
+///
+/// This check will try to enforce coding guidelines on the identifiers naming.
+/// It supports `lower_case`, `UPPER_CASE`, `camelBack` and `CamelCase` casing
+/// and tries to convert from one to another if a mismatch is detected.
+///
+/// It also supports a fixed prefix and suffix that will be prepended or
+/// appended to the identifiers, regardless of the casing.
+///
+/// Many configuration options are available, in order to be able to create
+/// different rules for different kind of identifier. In general, the
+/// rules are falling back to a more generic rule if the specific case is not
+/// configured.
class IdentifierNamingCheck : public ClangTidyCheck {
public:
IdentifierNamingCheck(StringRef Name, ClangTidyContext *Context);
Modified: clang-tools-extra/trunk/clang-tidy/readability/NamedParameterCheck.h
URL: http://llvm.org/viewvc/llvm-project/clang-tools-extra/trunk/clang-tidy/readability/NamedParameterCheck.h?rev=246169&r1=246168&r2=246169&view=diff
==============================================================================
--- clang-tools-extra/trunk/clang-tidy/readability/NamedParameterCheck.h (original)
+++ clang-tools-extra/trunk/clang-tidy/readability/NamedParameterCheck.h Thu Aug 27 13:01:58 2015
@@ -16,10 +16,11 @@ namespace clang {
namespace tidy {
namespace readability {
-/// \brief Find functions with unnamed arguments.
+/// Find functions with unnamed arguments.
///
/// The check implements the following rule originating in the Google C++ Style
/// Guide:
+///
/// http://google-styleguide.googlecode.com/svn/trunk/cppguide.xml?showone=Function_Declarations_and_Definitions#Function_Declarations_and_Definitions
///
/// All parameters should be named, with identical names in the declaration and
Modified: clang-tools-extra/trunk/clang-tidy/readability/NamespaceCommentCheck.h
URL: http://llvm.org/viewvc/llvm-project/clang-tools-extra/trunk/clang-tidy/readability/NamespaceCommentCheck.h?rev=246169&r1=246168&r2=246169&view=diff
==============================================================================
--- clang-tools-extra/trunk/clang-tidy/readability/NamespaceCommentCheck.h (original)
+++ clang-tools-extra/trunk/clang-tidy/readability/NamespaceCommentCheck.h Thu Aug 27 13:01:58 2015
@@ -17,9 +17,10 @@ namespace clang {
namespace tidy {
namespace readability {
-/// \brief Checks that long namespaces have a closing comment.
+/// Checks that long namespaces have a closing comment.
///
/// http://llvm.org/docs/CodingStandards.html#namespace-indentation
+///
/// http://google-styleguide.googlecode.com/svn/trunk/cppguide.html#Namespaces
class NamespaceCommentCheck : public ClangTidyCheck {
public:
Modified: clang-tools-extra/trunk/clang-tidy/readability/RedundantSmartptrGetCheck.h
URL: http://llvm.org/viewvc/llvm-project/clang-tools-extra/trunk/clang-tidy/readability/RedundantSmartptrGetCheck.h?rev=246169&r1=246168&r2=246169&view=diff
==============================================================================
--- clang-tools-extra/trunk/clang-tidy/readability/RedundantSmartptrGetCheck.h (original)
+++ clang-tools-extra/trunk/clang-tidy/readability/RedundantSmartptrGetCheck.h Thu Aug 27 13:01:58 2015
@@ -16,12 +16,15 @@ namespace clang {
namespace tidy {
namespace readability {
-/// \brief Find and remove redundant calls to smart pointer's .get() method.
+/// Find and remove redundant calls to smart pointer's `.get()` method.
///
/// Examples:
+///
+/// \code
/// ptr.get()->Foo() ==> ptr->Foo()
/// *ptr.get() ==> *ptr
/// *ptr->get() ==> **ptr
+/// \endcode
class RedundantSmartptrGetCheck : public ClangTidyCheck {
public:
RedundantSmartptrGetCheck(StringRef Name, ClangTidyContext *Context)
Modified: clang-tools-extra/trunk/clang-tidy/readability/RedundantStringCStrCheck.h
URL: http://llvm.org/viewvc/llvm-project/clang-tools-extra/trunk/clang-tidy/readability/RedundantStringCStrCheck.h?rev=246169&r1=246168&r2=246169&view=diff
==============================================================================
--- clang-tools-extra/trunk/clang-tidy/readability/RedundantStringCStrCheck.h (original)
+++ clang-tools-extra/trunk/clang-tidy/readability/RedundantStringCStrCheck.h Thu Aug 27 13:01:58 2015
@@ -16,7 +16,7 @@ namespace clang {
namespace tidy {
namespace readability {
-/// \brief Finds unnecessary calls to std::string::c_str().
+/// Finds unnecessary calls to `std::string::c_str()`.
class RedundantStringCStrCheck : public ClangTidyCheck {
public:
RedundantStringCStrCheck(StringRef Name, ClangTidyContext *Context)
Modified: clang-tools-extra/trunk/clang-tidy/readability/ShrinkToFitCheck.h
URL: http://llvm.org/viewvc/llvm-project/clang-tools-extra/trunk/clang-tidy/readability/ShrinkToFitCheck.h?rev=246169&r1=246168&r2=246169&view=diff
==============================================================================
--- clang-tools-extra/trunk/clang-tidy/readability/ShrinkToFitCheck.h (original)
+++ clang-tools-extra/trunk/clang-tidy/readability/ShrinkToFitCheck.h Thu Aug 27 13:01:58 2015
@@ -16,12 +16,12 @@ namespace clang {
namespace tidy {
namespace readability {
-/// \brief Replace copy and swap tricks on shrinkable containers with the
-/// \c shrink_to_fit() method call.
+/// Replace copy and swap tricks on shrinkable containers with the
+/// `shrink_to_fit()` method call.
///
-/// The \c shrink_to_fit() method is more readable and more effective than
+/// The `shrink_to_fit()` method is more readable and more effective than
/// the copy and swap trick to reduce the capacity of a shrinkable container.
-/// Note that, the \c shrink_to_fit() method is only available in C++11 and up.
+/// Note that, the `shrink_to_fit()` method is only available in C++11 and up.
class ShrinkToFitCheck : public ClangTidyCheck {
public:
ShrinkToFitCheck(StringRef Name, ClangTidyContext *Context)
Modified: clang-tools-extra/trunk/clang-tidy/readability/SimplifyBooleanExprCheck.h
URL: http://llvm.org/viewvc/llvm-project/clang-tools-extra/trunk/clang-tidy/readability/SimplifyBooleanExprCheck.h?rev=246169&r1=246168&r2=246169&view=diff
==============================================================================
--- clang-tools-extra/trunk/clang-tidy/readability/SimplifyBooleanExprCheck.h (original)
+++ clang-tools-extra/trunk/clang-tidy/readability/SimplifyBooleanExprCheck.h Thu Aug 27 13:01:58 2015
@@ -16,64 +16,71 @@ namespace clang {
namespace tidy {
namespace readability {
-/// \brief Looks for boolean expressions involving boolean constants and
-// simplifies them to use the appropriate boolean expression directly.
+/// Looks for boolean expressions involving boolean constants and simplifies
+/// them to use the appropriate boolean expression directly.
///
/// Examples:
-/// `if (b == true)` becomes `if (b)`
-/// `if (b == false)` becomes `if (!b)`
-/// `if (b && true)` becomes `if (b)`
-/// `if (b && false)` becomes `if (false)`
-/// `if (b || true)` becomes `if (true)`
-/// `if (b || false)` becomes `if (b)`
-/// `e ? true : false` becomes `e`
-/// `e ? false : true` becomes `!e`
-/// `if (true) t(); else f();` becomes `t();`
-/// `if (false) t(); else f();` becomes `f();`
-/// `if (e) return true; else return false;` becomes `return e;`
-/// `if (e) return false; else return true;` becomes `return !e;`
-/// `if (e) b = true; else b = false;` becomes `b = e;`
-/// `if (e) b = false; else b = true;` becomes `b = !e;`
-/// `if (e) return true; return false;` becomes `return e;`
-/// `if (e) return false; return true;` becomes `return !e;`
+///
+/// =========================================== ================
+/// Initial expression Result
+/// ------------------------------------------- ----------------
+/// `if (b == true)` `if (b)`
+/// `if (b == false)` `if (!b)`
+/// `if (b && true)` `if (b)`
+/// `if (b && false)` `if (false)`
+/// `if (b || true)` `if (true)`
+/// `if (b || false)` `if (b)`
+/// `e ? true : false` `e`
+/// `e ? false : true` `!e`
+/// `if (true) t(); else f();` `t();`
+/// `if (false) t(); else f();` `f();`
+/// `if (e) return true; else return false;` `return e;`
+/// `if (e) return false; else return true;` `return !e;`
+/// `if (e) b = true; else b = false;` `b = e;`
+/// `if (e) b = false; else b = true;` `b = !e;`
+/// `if (e) return true; return false;` `return e;`
+/// `if (e) return false; return true;` `return !e;`
+/// =========================================== ================
///
/// The resulting expression `e` is modified as follows:
-/// 1. Unnecessary parentheses around the expression are removed.
-/// 2. Negated applications of `!` are eliminated.
-/// 3. Negated applications of comparison operators are changed to use the
-/// opposite condition.
-/// 4. Implicit conversions of pointer to `bool` are replaced with explicit
-/// comparisons to `nullptr`.
-/// 5. Implicit casts to `bool` are replaced with explicit casts to `bool`.
-/// 6. Object expressions with `explicit operator bool` conversion operators
-/// are replaced with explicit casts to `bool`.
+/// 1. Unnecessary parentheses around the expression are removed.
+/// 2. Negated applications of `!` are eliminated.
+/// 3. Negated applications of comparison operators are changed to use the
+/// opposite condition.
+/// 4. Implicit conversions of pointer to `bool` are replaced with explicit
+/// comparisons to `nullptr`.
+/// 5. Implicit casts to `bool` are replaced with explicit casts to `bool`.
+/// 6. Object expressions with `explicit operator bool` conversion operators
+/// are replaced with explicit casts to `bool`.
///
/// Examples:
-/// 1. The ternary assignment `bool b = (i < 0) ? true : false;` has redundant
-/// parentheses and becomes `bool b = i < 0;`.
+/// 1. The ternary assignment `bool b = (i < 0) ? true : false;` has redundant
+/// parentheses and becomes `bool b = i < 0;`.
+///
+/// 2. The conditional return `if (!b) return false; return true;` has an
+/// implied double negation and becomes `return b;`.
+///
+/// 3. The conditional return `if (i < 0) return false; return true;` becomes
+/// `return i >= 0;`.
+///
+/// The conditional return `if (i != 0) return false; return true;` becomes
+/// `return i == 0;`.
+///
+/// 4. The conditional return `if (p) return true; return false;` has an
+/// implicit conversion of a pointer to `bool` and becomes
+/// `return p != nullptr;`.
+///
+/// The ternary assignment `bool b = (i & 1) ? true : false;` has an
+/// implicit conversion of `i & 1` to `bool` and becomes
+/// `bool b = static_cast<bool>(i & 1);`.
///
-/// 2. The conditional return `if (!b) return false; return true;` has an
-/// implied double negation and becomes `return b;`.
+/// 5. The conditional return `if (i & 1) return true; else return false;` has
+/// an implicit conversion of an integer quantity `i & 1` to `bool` and
+/// becomes `return static_cast<bool>(i & 1);`
///
-/// 3. The conditional return `if (i < 0) return false; return true;` becomes
-/// `return i >= 0;`.
-/// The conditional return `if (i != 0) return false; return true;` becomes
-/// `return i == 0;`.
-///
-/// 4. The conditional return `if (p) return true; return false;` has an
-/// implicit conversion of a pointer to `bool` and becomes
-/// `return p != nullptr;`.
-/// The ternary assignment `bool b = (i & 1) ? true : false;` has an implicit
-/// conversion of `i & 1` to `bool` and becomes
-/// `bool b = static_cast<bool>(i & 1);`.
-///
-/// 5. The conditional return `if (i & 1) return true; else return false;` has
-/// an implicit conversion of an integer quantity `i & 1` to `bool` and becomes
-/// `return static_cast<bool>(i & 1);`
-///
-/// 6. Given `struct X { explicit operator bool(); };`, and an instance `x` of
-/// `struct X`, the conditional return `if (x) return true; return false;`
-/// becomes `return static_cast<bool>(x);`
+/// 6. Given `struct X { explicit operator bool(); };`, and an instance `x` of
+/// `struct X`, the conditional return `if (x) return true; return false;`
+/// becomes `return static_cast<bool>(x);`
///
/// When a conditional boolean return or assignment appears at the end of a
/// chain of `if`, `else if` statements, the conditional statement is left
Modified: clang-tools-extra/trunk/clang-tidy/utils/HeaderGuard.h
URL: http://llvm.org/viewvc/llvm-project/clang-tools-extra/trunk/clang-tidy/utils/HeaderGuard.h?rev=246169&r1=246168&r2=246169&view=diff
==============================================================================
--- clang-tools-extra/trunk/clang-tidy/utils/HeaderGuard.h (original)
+++ clang-tools-extra/trunk/clang-tidy/utils/HeaderGuard.h Thu Aug 27 13:01:58 2015
@@ -15,7 +15,7 @@
namespace clang {
namespace tidy {
-/// \brief Finds and fixes header guards.
+/// Finds and fixes header guards.
class HeaderGuardCheck : public ClangTidyCheck {
public:
HeaderGuardCheck(StringRef Name, ClangTidyContext *Context)
More information about the cfe-commits
mailing list