diff options
Diffstat (limited to 'clang-tools-extra/clang-tidy/bugprone/ArgumentCommentCheck.cpp')
-rw-r--r-- | clang-tools-extra/clang-tidy/bugprone/ArgumentCommentCheck.cpp | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/clang-tools-extra/clang-tidy/bugprone/ArgumentCommentCheck.cpp b/clang-tools-extra/clang-tidy/bugprone/ArgumentCommentCheck.cpp index 07219f9c724..968333ce15e 100644 --- a/clang-tools-extra/clang-tidy/bugprone/ArgumentCommentCheck.cpp +++ b/clang-tools-extra/clang-tidy/bugprone/ArgumentCommentCheck.cpp @@ -230,9 +230,11 @@ static const FunctionDecl *resolveMocks(const FunctionDecl *Func) { // Given the argument type and the options determine if we should // be adding an argument comment. bool ArgumentCommentCheck::shouldAddComment(const Expr *Arg) const { + Arg = Arg->IgnoreImpCasts(); + if (isa<UnaryOperator>(Arg)) + Arg = cast<UnaryOperator>(Arg)->getSubExpr(); if (Arg->getExprLoc().isMacroID()) return false; - Arg = Arg->IgnoreImpCasts(); return (CommentBoolLiterals && isa<CXXBoolLiteralExpr>(Arg)) || (CommentIntegerLiterals && isa<IntegerLiteral>(Arg)) || (CommentFloatLiterals && isa<FloatingLiteral>(Arg)) || |