Author: sbenza
Date: Mon Jan 8 07:59:08 2018
New Revision: 322002
URL: http://llvm.org/viewvc/llvm-project?rev=322002&view=rev
Log:
[clang-tidy] Fix DanglingHandleCheck for the correct conversion operation
between basic_string and basic_string_view.
Summary:
Fix DanglingHandleCheck to handle th
sbenza added inline comments.
Comment at: clang-tidy/readability/RedundantMemberInitCheck.cpp:33
@@ +32,3 @@
+ const auto *Init = Result.Nodes.getNodeAs("init");
+ const auto *Construct =
Result.Nodes.getNodeAs("construct");
+ const auto arguments = Construct->arguments();
---
Author: sbenza
Date: Mon Jan 15 10:03:20 2018
New Revision: 322497
URL: http://llvm.org/viewvc/llvm-project?rev=322497&view=rev
Log:
[clang-tidy] Expand readability-redundant-smartptr-get to understand implicit
converions to bool in more contexts.
Summary: Expand readability-redundant-smartptr-g
sbenza added inline comments.
Comment at:
test/clang-tidy/cppcoreguidelines-pro-type-static-cast-downcast.cpp:19
@@ +18,3 @@
+ // CHECK-MESSAGES: :[[@LINE-1]]:13: warning: do not use static_cast to cast
from base to derived. Use dynamic_cast instead. (C++ Core Guidelines, rule
sbenza added inline comments.
Comment at: clang-tidy/cppcoreguidelines/ProBoundsPointerArithmeticCheck.cpp:38
@@ +37,3 @@
+ Finder->addMatcher(
+ arraySubscriptExpr(hasBase(implicitCastExpr(hasSourceExpression(
+ hasType(pointerType()).bind("e
sbenza added inline comments.
Comment at: clang-tidy/cppcoreguidelines/ProBoundsPointerArithmeticCheck.cpp:35
@@ +34,3 @@
+
+ //Array subscript on a pointer (not an array) is also pointer arithmetic
+ Finder->addMatcher(
Space after //
Comment
sbenza accepted this revision.
sbenza added a comment.
This revision is now accepted and ready to land.
See comment regarding //CHECKs
Comment at: test/clang-tidy/cert-variadic-function-def.cpp:4
@@ +3,3 @@
+// Variadic function definitions are diagnosed.
+// CHECK-MESSAGES: :[[
sbenza added inline comments.
Comment at:
test/clang-tidy/cppcoreguidelines-pro-type-static-cast-downcast.cpp:28
@@ +27,3 @@
+
+ auto P0 = static_cast(new Base());
+ // CHECK-MESSAGES: :[[@LINE-1]]:13: warning: do not use static_cast to
downcast from a base to a derived class
sbenza added inline comments.
Comment at: clang-tidy/misc/MoveConstantArgumentCheck.cpp:20
@@ +19,3 @@
+ const auto* CallMove = result.Nodes.getNodeAs("call-move");
+ if (CallMove->getNumArgs() != 1) return;
+ const Expr* Arg = CallMove->getArg(0);
You can move
Author: sbenza
Date: Wed Aug 26 11:15:59 2015
New Revision: 246037
URL: http://llvm.org/viewvc/llvm-project?rev=246037&view=rev
Log:
[ASTMatchers] Add type matcher for SubstTemplateTypeParmType.
Modified:
cfe/trunk/include/clang/ASTMatchers/ASTMatchers.h
cfe/trunk/lib/ASTMatchers/Dynamic/
sbenza added a comment.
In http://reviews.llvm.org/D13510#261925, @aaron.ballman wrote:
> In http://reviews.llvm.org/D13510#261825, @Eugene.Zelenko wrote:
>
> > I think it'll be fine to rename check without leaving traces of misc. Same
> > thing happened with modernize-shrink-to-fit.
>
>
> I thi
sbenza added inline comments.
Comment at: clang-tidy/cert/SetLongJmpCheck.cpp:31
@@ +30,3 @@
+public:
+ explicit SetJmpMacroCallbacks(Preprocessor *PP, SetLongJmpCheck &Check)
+ : PP(PP), Check(Check) {}
Why do you pass one as a pointer and one as a referenc
sbenza added inline comments.
Comment at:
clang-tidy/cppcoreguidelines/ProBoundsArrayToPointerDecayCheck.cpp:29
@@ +28,3 @@
+ implicitCastExpr(unless(hasParent(arraySubscriptExpr())),
+
unless(hasSourceExpression(declRefExpr(to(varDecl(hasName("__range
sbenza accepted this revision.
sbenza added a comment.
This revision is now accepted and ready to land.
Seems straightforward.
http://reviews.llvm.org/D13784
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailm
sbenza added inline comments.
Comment at: clang-tidy/cppcoreguidelines/ProTypeVarargUseCheck.cpp:20
@@ +19,3 @@
+void ProTypeVarargUseCheck::registerMatchers(MatchFinder *Finder) {
+
Finder->addMatcher(callExpr(callee(functionDecl(isVariadic(.bind("expr"),
this);
+}
---
sbenza added inline comments.
Comment at: clang-tidy/cppcoreguidelines/ProTypeUnionAccessCheck.cpp:20
@@ +19,3 @@
+void ProTypeUnionAccessCheck::registerMatchers(MatchFinder *Finder) {
+
Finder->addMatcher(memberExpr(hasObjectExpression(hasType(recordDecl(isUnion().bind("exp
sbenza added a comment.
Thanks for the patch.
A few comments below.
Comment at: clang-tidy/cppcoreguidelines/ProBoundsConstantArrayIndexCheck.cpp:23
@@ +22,3 @@
+
+
Finder->addMatcher(arraySubscriptExpr(hasBase(ignoringImpCasts(hasType(constantArrayType().bind("type",
+
sbenza added inline comments.
Comment at: clang-tidy/cppcoreguidelines/ProBoundsConstantArrayIndexCheck.cpp:55
@@ +54,3 @@
+ if (!IndexExpr->isIntegerConstantExpr(Index, *Result.Context, nullptr,
true)) {
+//Fixit would need gsl::at()
+diag(Matched->getExprLoc(), "do not
sbenza added inline comments.
Comment at: clang-tidy/cppcoreguidelines/ProTypeVarargUseCheck.cpp:20
@@ +19,3 @@
+void ProTypeVarargUseCheck::registerMatchers(MatchFinder *Finder) {
+
Finder->addMatcher(callExpr(callee(functionDecl(isVariadic(.bind("expr"),
this);
+}
---
sbenza added inline comments.
Comment at: clang-tidy/cppcoreguidelines/ProTypeVarargCheck.cpp:26
@@ +25,3 @@
+ Finder->addMatcher(
+ varDecl(hasType(pointsTo(cxxRecordDecl(hasName("__va_list_tag")
+ .bind("va_list"),
Is there a way to look for t
sbenza added inline comments.
Comment at: test/clang-tidy/cppcoreguidelines-pro-type-vararg.cpp:27
@@ +26,3 @@
+template
+void CallFooIfAvailableImpl(T& t, ...) {
+}
You would still warn on the callers of this.
Maybe we should ignore any call if the variadic part
Author: sbenza
Date: Mon Oct 19 16:49:51 2015
New Revision: 250742
URL: http://llvm.org/viewvc/llvm-project?rev=250742&view=rev
Log:
Added check uniqueptr-delete-release to replace "delete x.release()" with "x =
nullptr"
Reviewers: alexfh
Differential Revision: http://reviews.llvm.org/D13179
A
sbenza created this revision.
sbenza added reviewers: alexfh, aaron.ballman.
sbenza added a subscriber: cfe-commits.
Fix bug in suggested fix that truncated variable names to 1 character.
Also, rework the suggested fix to try to remove unnecessary whitespace.
http://reviews.llvm.org/D13899
Files
On Mon, Oct 19, 2015 at 6:00 PM, David Blaikie wrote:
>
>
> On Mon, Oct 19, 2015 at 2:49 PM, Samuel Benzaquen via cfe-commits <
> cfe-commits@lists.llvm.org> wrote:
>
>> Author: sbenza
>> Date: Mon Oct 19 16:49:51 2015
>> New Revision: 250742
>>
&g
sbenza added a comment.
Minor comments only.
Comment at: clang-tidy/cppcoreguidelines/ProTypeVarargCheck.cpp:29
@@ +28,3 @@
+ callExpr(callee(functionDecl(isVariadic(),
+ unless(hasName("__builtin_va_start")
+ .bind("callvararg
sbenza accepted this revision.
sbenza added a comment.
This revision is now accepted and ready to land.
Thanks for check.
http://reviews.llvm.org/D13787
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/li
sbenza added inline comments.
Comment at: include/clang/AST/ASTTypeTraits.h:250
@@ +249,3 @@
+return NodeKind.hasPointerIdentity()
+ ? *reinterpret_cast(Storage.buffer)
+ : nullptr;
I'm not sure about this reinterpret_cast.
We are n
sbenza accepted this revision.
This revision is now accepted and ready to land.
Comment at: include/clang/AST/ASTTypeTraits.h:300
@@ -288,2 +299,3 @@
if (ASTNodeKind::getFromNodeKind().isBaseOf(NodeKind))
-return cast(*reinterpret_cast(Storage));
+return cas
sbenza added a comment.
I'm sorry. This change fell through the cracks. I'll take a look today.
http://reviews.llvm.org/D7639
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
sbenza accepted this revision.
sbenza added a comment.
This revision is now accepted and ready to land.
Just one formatting comment.
Comment at:
clang-tidy/cppcoreguidelines/ProBoundsArrayToPointerDecayCheck.cpp:52
@@ +51,3 @@
+
+ diag(MatchedCast->getExprLoc(), "do not implic
sbenza accepted this revision.
sbenza added a comment.
This revision is now accepted and ready to land.
Thanks for the fix.
http://reviews.llvm.org/D14049
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/
sbenza added a comment.
Just fyi, I am looking at this diff. It is very large with a lot of rounds of
comments and I didn't have the context.
I don't know if I should giving comments at this point of the change, but here
it is.
Have you considered matching on typeLoc() instead of having a large
sbenza added inline comments.
Comment at: clang-tidy/cppcoreguidelines/ProTypeCstyleCastCheck.cpp:44
@@ +43,3 @@
+ if (MatchedCast->getCastKind() == CK_BitCast ||
+ MatchedCast->getCastKind() == CK_LValueBitCast ||
+ MatchedCast->getCastKind() == CK_IntegralToPointer ||
sbenza added a comment.
In http://reviews.llvm.org/D14096#275902, @xazax.hun wrote:
> There is already a similar check in the Google package. What are the
> differences between those two checks? What is the reason we can not just
> register that check into the core guidelines module?
That oth
sbenza accepted this revision.
sbenza added a comment.
This revision is now accepted and ready to land.
Just wanted to know it was considered, and it was.
It looks good to me then.
http://reviews.llvm.org/D7639
___
cfe-commits mailing list
cfe-commi
sbenza added inline comments.
Comment at: clang-tidy/misc/UnusedParametersCheck.cpp:25
@@ +24,3 @@
+template
+static CharSourceRange removeNode(const MatchFinder::MatchResult &Result,
+ const T *PrevNode, const T *Node,
aaron.ball
Author: sbenza
Date: Wed Nov 11 12:40:36 2015
New Revision: 252773
URL: http://llvm.org/viewvc/llvm-project?rev=252773&view=rev
Log:
Fix bug in suggested fix that truncated variable names to 1 character.
Summary:
Fix bug in suggested fix that truncated variable names to 1 character.
Also, rework
This revision was automatically updated to reflect the committed changes.
Closed by commit rL252773: Fix bug in suggested fix that truncated variable
names to 1 character. (authored by sbenza).
Changed prior to commit:
http://reviews.llvm.org/D13899?vs=37885&id=39944#toc
Repository:
rL LLVM
sbenza added inline comments.
Comment at: clang-tidy/misc/MoveForwardingReferenceCheck.cpp:20
@@ +19,3 @@
+
+static void ReplaceMoveWithForward(const UnresolvedLookupExpr *Callee,
+ const TemplateTypeParmType *TypeParmType,
aaron.
One of the reasons we added the minimum was because these nodes added
overhead to the matching that was not unnecessary when they only had a
single node.
On the current implementation we could actually get rid of the node
completely for the one argument calls.
I would be ok with removing the lower
sbenza added inline comments.
Comment at: clang-tidy/misc/MoveForwardingReferenceCheck.cpp:93
@@ +92,3 @@
+ hasArgument(0, ignoringParenImpCasts(declRefExpr(
+ to(ForwardingReferenceParmMatcher)
+ .bind("call-move"),
sbenza added inline comments.
Comment at: clang-tidy/misc/MoveForwardingReferenceCheck.cpp:64
@@ +63,3 @@
+void MoveForwardingReferenceCheck::registerMatchers(MatchFinder *Finder) {
+ if (!getLangOpts().CPlusPlus11)
+return;
I'm guessing this is checking Lang
sbenza updated this revision to Diff 46796.
sbenza added a comment.
Added comment about StringLikeClasses
http://reviews.llvm.org/D16152
Files:
clang-tidy/performance/CMakeLists.txt
clang-tidy/performance/FasterStringFindCheck.cpp
clang-tidy/performance/FasterStringFindCheck.h
clang-tid
sbenza updated this revision to Diff 46798.
sbenza added a comment.
Make the delimiter a constant and fix mismatch between parse/serialize of the
option.
http://reviews.llvm.org/D16152
Files:
clang-tidy/performance/CMakeLists.txt
clang-tidy/performance/FasterStringFindCheck.cpp
clang-tid
Author: sbenza
Date: Fri Feb 5 12:29:24 2016
New Revision: 259898
URL: http://llvm.org/viewvc/llvm-project?rev=259898&view=rev
Log:
[ASTMatchers] Allow hasName() to look through inline namespaces
Summary:
Allow hasName() to look through inline namespaces.
This will fix the interaction between so
This revision was automatically updated to reflect the committed changes.
Closed by commit rL259898: [ASTMatchers] Allow hasName() to look through inline
namespaces (authored by sbenza).
Changed prior to commit:
http://reviews.llvm.org/D15506?vs=45438&id=47029#toc
Repository:
rL LLVM
http:/
Now that I submitted the fix to hasName(), I'll work on adding hasAnyName.
On Tue, Feb 9, 2016 at 6:54 AM, Alexander Kornienko
wrote:
> I think, we need to add a `hasAnyName()` matcher that would take a list of
> names.
>
> On Tue, Feb 9, 2016 at 11:20 AM, Gabor Horvath via cfe-commits <
> cfe-c
sbenza added inline comments.
Comment at: include/clang/ASTMatchers/ASTMatchers.h:4821
@@ +4820,3 @@
+/// initializer for i.
+AST_MATCHER(Expr, nullPointerConstant) {
+ return Matcher(
Use AST_MATCHER_FUNCTION instead, where the return value is the matcher
(in
sbenza added inline comments.
Comment at: include/clang/ASTMatchers/ASTMatchers.h:4821
@@ +4820,3 @@
+/// initializer for i.
+AST_MATCHER(Expr, nullPointerConstant) {
+ return Matcher(
aaron.ballman wrote:
> aaron.ballman wrote:
> > sbenza wrote:
> > > sbenza w
sbenza created this revision.
sbenza added a reviewer: alexfh.
sbenza added a subscriber: cfe-commits.
Herald added a subscriber: klimek.
Add matcher hasAnyName as an optimization over anyOf(hasName(),...)
http://reviews.llvm.org/D17163
Files:
docs/LibASTMatchersReference.html
docs/tools/dum
sbenza added a comment.
Friendly ping.
http://reviews.llvm.org/D16152
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
sbenza added inline comments.
Comment at: include/clang/ASTMatchers/ASTMatchersInternal.h:644
@@ -643,2 +643,3 @@
explicit HasNameMatcher(StringRef Name);
+ explicit HasNameMatcher(ArrayRef Names);
alexfh wrote:
> bkramer wrote:
> > alexfh wrote:
> > > Why n
sbenza updated this revision to Diff 47802.
sbenza marked 2 inline comments as done.
sbenza added a comment.
Minor fixes:
- Add argument comments
- Move vector contructor to callers to simply API of HasNameMatcher
http://reviews.llvm.org/D17163
Files:
docs/LibASTMatchersReference.html
docs
sbenza updated this revision to Diff 47808.
sbenza marked an inline comment as done.
sbenza added a comment.
Minor fix on comment
http://reviews.llvm.org/D16152
Files:
clang-tidy/performance/CMakeLists.txt
clang-tidy/performance/FasterStringFindCheck.cpp
clang-tidy/performance/FasterStrin
Author: sbenza
Date: Fri Feb 12 13:28:14 2016
New Revision: 260712
URL: http://llvm.org/viewvc/llvm-project?rev=260712&view=rev
Log:
[clang-tidy] Add check performance-faster-string-find
Summary:
Add check performance-faster-string-find.
It replaces single character string literals to character l
This revision was automatically updated to reflect the committed changes.
Closed by commit rL260712: [clang-tidy] Add check
performance-faster-string-find (authored by sbenza).
Changed prior to commit:
http://reviews.llvm.org/D16152?vs=47808&id=47825#toc
Repository:
rL LLVM
http://reviews.l
sbenza added inline comments.
Comment at: include/clang/ASTMatchers/ASTMatchers.h:4838
@@ +4837,3 @@
+ gnuNullExpr(), cxxNullPtrLiteralExpr(),
+ expr(integerLiteral(equals(0),
hasParent(expr(hasType(pointerType()));
+}
is this expr() necessary?
ht
sbenza added inline comments.
Comment at: include/clang/ASTMatchers/ASTMatchers.h:4838
@@ +4837,3 @@
+ gnuNullExpr(), cxxNullPtrLiteralExpr(),
+ expr(integerLiteral(equals(0),
hasParent(expr(hasType(pointerType()));
+}
aaron.ballman wrote:
> sbenza
Author: sbenza
Date: Wed Feb 17 10:13:14 2016
New Revision: 261102
URL: http://llvm.org/viewvc/llvm-project?rev=261102&view=rev
Log:
[clang-tidy] Match the type against the get() method we are calling,
instead of a get() method we find in the class.
The duck typed smart pointer class could have o
sbenza added inline comments.
Comment at: clang-tidy/cert/CommandProcessorCheck.cpp:22
@@ +21,3 @@
+ Finder->addMatcher(
+ callExpr(callee(functionDecl(anyOf(hasName("system"), hasName("popen"),
+ hasName("_popen")))
S
sbenza added inline comments.
Comment at: clang-tidy/cert/CommandProcessorCheck.cpp:36
@@ +35,3 @@
+ // is not a security risk by itself.
+ if (Fn->getName() == "system" && E->getNumArgs() == 1 &&
+ E->getArg(0)->isNullPointerConstant(*Result.Context,
You c
This revision was automatically updated to reflect the committed changes.
Closed by commit rL261574: [ASTMatchers] Add matcher hasAnyName. (authored by
sbenza).
Changed prior to commit:
http://reviews.llvm.org/D17163?vs=47802&id=48720#toc
Repository:
rL LLVM
http://reviews.llvm.org/D17163
Author: sbenza
Date: Mon Feb 22 15:13:02 2016
New Revision: 261574
URL: http://llvm.org/viewvc/llvm-project?rev=261574&view=rev
Log:
[ASTMatchers] Add matcher hasAnyName.
Summary: Add matcher hasAnyName as an optimization over anyOf(hasName(),...)
Reviewers: alexfh
Subscribers: klimek, cfe-comm
On Mon, Feb 22, 2016 at 4:19 PM, Aaron Ballman
wrote:
> On Mon, Feb 22, 2016 at 4:13 PM, Samuel Benzaquen via cfe-commits
> wrote:
> > Author: sbenza
> > Date: Mon Feb 22 15:13:02 2016
> > New Revision: 261574
> >
> > URL: http://llvm.org/viewvc/llvm
On Mon, Feb 22, 2016 at 4:44 PM, Aaron Ballman
wrote:
> On Mon, Feb 22, 2016 at 4:43 PM, Samuel Benzaquen
> wrote:
> >
> > On Mon, Feb 22, 2016 at 4:19 PM, Aaron Ballman
> > wrote:
> >>
> >> On Mon, Feb 22, 2016 at 4:13 PM, Samuel Benzaquen via cfe-
On Mon, Feb 22, 2016 at 5:27 PM, Hans Wennborg wrote:
> On Mon, Feb 22, 2016 at 1:13 PM, Samuel Benzaquen via cfe-commits
> wrote:
> > Author: sbenza
> > Date: Mon Feb 22 15:13:02 2016
> > New Revision: 261574
> >
> > URL: http://llvm.org/viewvc/llvm
sbenza added a comment.
I assume you checked that the new trait works on MSVC.
Aren't both the same type of expression SFINAE? Is somehow one supported but
not the other?
http://reviews.llvm.org/D17575
___
cfe-commits mailing list
cfe-commits@lists
sbenza accepted this revision.
Comment at: clang-tidy/misc/UnconventionalAssignOperatorCheck.cpp:69
@@ +68,3 @@
+void UnconventionalAssignOperatorCheck::check(const MatchFinder::MatchResult
&Result) {
+ if (const auto *RetStmt = Result.Nodes.getNodeAs("returnStmt")) {
+diag(
sbenza added a comment.
In http://reviews.llvm.org/D19871#419985, @aaron.ballman wrote:
> In http://reviews.llvm.org/D19871#419954, @etienneb wrote:
>
> > In http://reviews.llvm.org/D19871#419947, @aaron.ballman wrote:
> >
> > > Is this required for some purpose?
> >
> >
> > It's used in clang-ti
sbenza added a comment.
> > So even if the above solution is working, we still need to call it that way
> > (as a string):
>
> > clang-query> match castExpr(hasCastKind("CK_Dependent"))
>
>
> Correct, that's expected behavior for clang-query (though I would love if
> someday we could
sbenza created this revision.
sbenza added a reviewer: alexfh.
sbenza added a subscriber: cfe-commits.
Speedup the misc-static-assert check by not use `stmt()` as the toplevel
matcher.
The framework runs a filter on the matchers before trying them on each node and
uses the toplevel type for this.
Author: sbenza
Date: Tue May 3 15:11:09 2016
New Revision: 268430
URL: http://llvm.org/viewvc/llvm-project?rev=268430&view=rev
Log:
[clang-tidy] Speedup misc-static-assert.
Summary:
Speedup the misc-static-assert check by not use `stmt()` as the toplevel
matcher.
The framework runs a filter on
This revision was automatically updated to reflect the committed changes.
Closed by commit rL268430: [clang-tidy] Speedup misc-static-assert. (authored
by sbenza).
Changed prior to commit:
http://reviews.llvm.org/D19877?vs=56028&id=56053#toc
Repository:
rL LLVM
http://reviews.llvm.org/D1987
Author: sbenza
Date: Wed May 4 15:45:00 2016
New Revision: 268548
URL: http://llvm.org/viewvc/llvm-project?rev=268548&view=rev
Log:
Fix the doc extraction script to work with hasAnyName and with equalsNode.
The change from llvm::VariadicFunction to internal::VariadicFunction
broke the extraction
sbenza added inline comments.
Comment at: lib/ASTMatchers/Dynamic/Marshallers.h:102
@@ +101,3 @@
+ static clang::CastKind getCastKind(llvm::StringRef AttrKind) {
+return llvm::StringSwitch(AttrKind)
+ .Case("CK_Dependent", CK_Dependent)
etienneb wrote:
>
sbenza added inline comments.
Comment at: lib/ASTMatchers/Dynamic/Registry.cpp:78
@@ -77,2 +77,3 @@
// Need Variant/Parser fixes:
+ // hasCastKind
// ofKind
Is it registered or not?
You add this comment, but also add the matcher in the registry below.
h
sbenza added inline comments.
Comment at: clang-tidy/performance/UnnecessaryValueParamCheck.cpp:83
@@ +82,3 @@
+ if (!IsConstQualified) {
+auto Matches = utils::decl_ref_expr::allDeclRefExprs(
+*Param, *Function->getBody(), *Result.Context);
We should
sbenza added a comment.
In http://reviews.llvm.org/D18475#385789, @alexfh wrote:
> Looks good to me. Adding Samuel, since he has done a lot of similar stuff by
> now and might have good ideas on improving this and making this more general.
There are two things I've done before that might apply
Author: sbenza
Date: Tue Mar 29 13:02:26 2016
New Revision: 264759
URL: http://llvm.org/viewvc/llvm-project?rev=264759&view=rev
Log:
[clang-tidy] Add check to detect dangling references in value handlers.
Summary:
Add check misc-dangling-handle to detect dangling references in value
handlers like
This revision was automatically updated to reflect the committed changes.
Closed by commit rL264759: [clang-tidy] Add check to detect dangling references
in value handlers. (authored by sbenza).
Changed prior to commit:
http://reviews.llvm.org/D17811?vs=51684&id=51956#toc
Repository:
rL LLVM
This is already being done in http://reviews.llvm.org/D18582
On Wed, Mar 30, 2016 at 12:44 PM, Richard wrote:
> LegalizeAdulthood added a subscriber: LegalizeAdulthood.
> LegalizeAdulthood added a comment.
>
> Can you add a synopsis of this new check to `docs/ReleaseNotes.rst` please?
>
>
> Repo
t;>
>> On Fri, Mar 25, 2016 at 10:46 AM, Samuel Benzaquen via cfe-commits <
>> cfe-commits@lists.llvm.org> wrote:
>>
>>> Author: sbenza
>>> Date: Fri Mar 25 12:46:02 2016
>>> New Revision: 264428
>>>
>>> URL: http://llvm.org/view
to the function pointer template
>> parameter.
>> gcc doesn't want to do the implicit conversion from X to A, but if I make
>> the conversion explicit it works.
>>
>>
>> On Fri, Mar 25, 2016 at 1:58 PM, Alexey Samsonov
>> wrote:
>>
>>>
sbenza added inline comments.
Comment at: clang-tidy/misc/AssignOperatorCheck.cpp:63
@@ +62,3 @@
+
+ Finder->addMatcher(returnStmt(IsBadReturnStatement,
hasAncestor(IsGoodAssign))
+ .bind("returnStmt"),
I dislike these uses of hasAnscesto
sbenza added a comment.
As Alex mentioned, we have a test like this.
It also adds a hardcoded list of user-defined types that are known to be better
when passed by value (eg. StringRef)
One big difference is that we decided to not trigger on typedefs.
We can't know that the typedef is documented
sbenza added a comment.
In http://reviews.llvm.org/D18191#391168, @sdowney wrote:
> At least in my codebase, skipping templates is too strong. I run across ones
> where the const& parameter is not one controlled by a template. It's often a
> size_t.
The only check we are doing (other than mat
sbenza created this revision.
sbenza added a reviewer: alexfh.
sbenza added a subscriber: cfe-commits.
The check detects multi-statement macros that are used in unbraced conditionals.
Only the first statement will be part of the conditionals and the rest will fall
outside of it and executed uncond
sbenza updated this revision to Diff 52625.
sbenza marked an inline comment as done.
sbenza added a comment.
Minor fixes
http://reviews.llvm.org/D18766
Files:
clang-tidy/misc/CMakeLists.txt
clang-tidy/misc/MiscTidyModule.cpp
clang-tidy/misc/MultipleStatementMacroCheck.cpp
clang-tidy/mis
sbenza marked an inline comment as done and an inline comment as not done.
Comment at: clang-tidy/misc/MultipleStatementMacroCheck.cpp:33
@@ +32,3 @@
+
+namespace {
+
etienneb wrote:
> I feel it nicer if you merge this namespace with the one at line 20.
I like to
sbenza added inline comments.
Comment at: clang-tidy/misc/AssignOperatorCheck.cpp:63
@@ +62,3 @@
+
+ Finder->addMatcher(returnStmt(IsBadReturnStatement,
hasAncestor(IsGoodAssign))
+ .bind("returnStmt"),
baloghadamsoftware wrote:
> sbenza
sbenza updated this revision to Diff 52702.
sbenza marked 2 inline comments as done and an inline comment as not done.
sbenza added a comment.
Minor fixes
http://reviews.llvm.org/D18766
Files:
clang-tidy/misc/CMakeLists.txt
clang-tidy/misc/MiscTidyModule.cpp
clang-tidy/misc/MultipleStatem
sbenza added inline comments.
Comment at: docs/clang-tidy/checks/misc-multiple-statement-macro.rst:15
@@ +14,3 @@
+ if (do_increment)
+INCREMENT_TWO(a, b);
+
hokein wrote:
> Would be better to add a comment to explain the sample.
The sentence just before the
sbenza added inline comments.
Comment at: clang-tidy/misc/AssignOperatorCheck.cpp:63
@@ +62,3 @@
+
+ Finder->addMatcher(returnStmt(IsBadReturnStatement,
hasAncestor(IsGoodAssign))
+ .bind("returnStmt"),
baloghadamsoftware wrote:
> sbenza
sbenza added inline comments.
Comment at: clang-tidy/readability/RedundantInlineCheck.cpp:59
@@ +58,3 @@
+ while (!RawLexer.LexFromRawLexer(Tok)) {
+if (Tok.is(tok::semi) || Tok.is(tok::l_brace))
+ break;
Parsing C++ is hard.
Stopping at the first `{` me
sbenza added inline comments.
Comment at: clang-tidy/readability/RedundantInlineCheck.cpp:68
@@ +67,3 @@
+ }
+ llvm_unreachable("InlineTok() did not encounter the 'inline' token");
+}
This is still reachable.
The token might be hidden through macros, for example
sbenza updated this revision to Diff 53398.
sbenza marked an inline comment as done.
sbenza added a comment.
Change warning message.
http://reviews.llvm.org/D18766
Files:
clang-tidy/misc/CMakeLists.txt
clang-tidy/misc/MiscTidyModule.cpp
clang-tidy/misc/MultipleStatementMacroCheck.cpp
cl
sbenza added inline comments.
Comment at: clang-tidy/misc/MultipleStatementMacroCheck.cpp:99
@@ +98,3 @@
+
+ diag(InnerRanges.back().first, "multiple statement macro spans unbraced "
+ "conditional and the following statement");
al
sbenza added a comment.
Those tests are testing the code completion you get in clang-query.
The type list must match what that matcher supports.
`hasParent` is declared as
const internal::ArgumentAdaptingMatcherFunc<
internal::HasParentMatcher,
internal::TypeList,
internal::T
sbenza added inline comments.
Comment at: clang-tidy/misc/AssignOperatorCheck.cpp:63
@@ +62,3 @@
+
+ Finder->addMatcher(returnStmt(IsBadReturnStatement,
hasAncestor(IsGoodAssign))
+ .bind("returnStmt"),
baloghadamsoftware wrote:
> sbenza
Author: sbenza
Date: Thu Apr 14 16:15:57 2016
New Revision: 266369
URL: http://llvm.org/viewvc/llvm-project?rev=266369&view=rev
Log:
[clang-tidy] Add check misc-multiple-statement-macro
Summary:
The check detects multi-statement macros that are used in unbraced conditionals.
Only the first statem
1 - 100 of 176 matches
Mail list logo