[PATCH] D50619: [clang-tidy] Handle unresolved expressions in ExprMutationAnalyzer

2018-09-10 Thread Shuai Wang via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rCTE341848: [clang-tidy] Handle unresolved expressions in ExprMutationAnalyzer (authored by shuaiwang, committed by ). Changed prior to commit: https://reviews.llvm.org/D50619?vs=160960&id=164704#toc Rep

[PATCH] D50619: [clang-tidy] Handle unresolved expressions in ExprMutationAnalyzer

2018-09-10 Thread Jonas Toth via Phabricator via cfe-commits
JonasToth accepted this revision. JonasToth added a comment. This revision is now accepted and ready to land. Ups, sorry i overlooked. I applied your changes to the current version of the const check, and everything seems fine. The false negative is gone. Repository: rCTE Clang Tools Extra

[PATCH] D50619: [clang-tidy] Handle unresolved expressions in ExprMutationAnalyzer

2018-09-09 Thread Shuai Wang via Phabricator via cfe-commits
shuaiwang added a comment. Ping :) Repository: rCTE Clang Tools Extra https://reviews.llvm.org/D50619 ___ cfe-commits mailing list cfe-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[PATCH] D50619: [clang-tidy] Handle unresolved expressions in ExprMutationAnalyzer

2018-08-22 Thread Jonas Toth via Phabricator via cfe-commits
JonasToth added a comment. Sure, thanks for the fast fix :) Am 22.08.2018 um 00:04 schrieb Shuai Wang via Phabricator: > shuaiwang added a comment. > > In https://reviews.llvm.org/D50619#1207785, @JonasToth wrote: > >> @shuaiwang Unfortunatly the analysis does not pass and fails on an assertio

[PATCH] D50619: [clang-tidy] Handle unresolved expressions in ExprMutationAnalyzer

2018-08-21 Thread Shuai Wang via Phabricator via cfe-commits
shuaiwang added a comment. In https://reviews.llvm.org/D50619#1207785, @JonasToth wrote: > @shuaiwang Unfortunatly the analysis does not pass and fails on an assertion > > → ~/opt/llvm/build/bin/clang-tidy > -checks=-*,cppcoreguidelines-const-correctness ItaniumDemangle.cpp -- > clang-tidy:

[PATCH] D50619: [clang-tidy] Handle unresolved expressions in ExprMutationAnalyzer

2018-08-21 Thread Jonas Toth via Phabricator via cfe-commits
JonasToth added a comment. @shuaiwang Unfortunatly the analysis does not pass and fails on an assertion → ~/opt/llvm/build/bin/clang-tidy -checks=-*,cppcoreguidelines-const-correctness ItaniumDemangle.cpp -- clang-tidy: ../tools/clang/include/clang/AST/ExprCXX.h:3581: clang::Expr* clang::CX

[PATCH] D50619: [clang-tidy] Handle unresolved expressions in ExprMutationAnalyzer

2018-08-16 Thread Shuai Wang via Phabricator via cfe-commits
shuaiwang added a comment. In https://reviews.llvm.org/D50619#1202135, @JonasToth wrote: > @shuaiwang i tried to apply this and check the clang-tidy part again, but it > does not compile (log attached). > I update clang to master, did you add a matcher or something like this? > > F6950472: erro

[PATCH] D50619: [clang-tidy] Handle unresolved expressions in ExprMutationAnalyzer

2018-08-16 Thread Jonas Toth via Phabricator via cfe-commits
JonasToth added a comment. @shuaiwang i tried to apply this and check the clang-tidy part again, but it does not compile (log attached). I update clang to master, did you add a matcher or something like this? F6950472: error.log Repository: rCTE Clang Tool

[PATCH] D50619: [clang-tidy] Handle unresolved expressions in ExprMutationAnalyzer

2018-08-16 Thread Jonas Toth via Phabricator via cfe-commits
JonasToth added a comment. You are totally right. Am 16.08.2018 um 02:41 schrieb Shuai Wang via Phabricator: > shuaiwang added inline comments. > > > Comment at: unittests/clang-tidy/ExprMutationAnalyzerTest.cpp:309 > > +TEST(ExprMutationAnalyzerTest, CallUnresolved) { > +

[PATCH] D50619: [clang-tidy] Handle unresolved expressions in ExprMutationAnalyzer

2018-08-16 Thread Jonas Toth via Phabricator via cfe-commits
JonasToth added a comment. I see, thank you for the clarification :) Am 15.08.2018 um 19:25 schrieb Shuai Wang via Phabricator: > shuaiwang added inline comments. > > > Comment at: unittests/clang-tidy/ExprMutationAnalyzerTest.cpp:410 > + match(withEnclosingCompound(decl

[PATCH] D50619: [clang-tidy] Handle unresolved expressions in ExprMutationAnalyzer

2018-08-15 Thread Shuai Wang via Phabricator via cfe-commits
shuaiwang updated this revision to Diff 160960. shuaiwang added a comment. Test case with non-type template Repository: rCTE Clang Tools Extra https://reviews.llvm.org/D50619 Files: clang-tidy/utils/ExprMutationAnalyzer.cpp unittests/clang-tidy/ExprMutationAnalyzerTest.cpp Index: unitte

[PATCH] D50619: [clang-tidy] Handle unresolved expressions in ExprMutationAnalyzer

2018-08-15 Thread Shuai Wang via Phabricator via cfe-commits
shuaiwang added inline comments. Comment at: unittests/clang-tidy/ExprMutationAnalyzerTest.cpp:309 +TEST(ExprMutationAnalyzerTest, CallUnresolved) { + auto AST = JonasToth wrote: > I think we are missing tests for non-type template paramters (`template > `).

[PATCH] D50619: [clang-tidy] Handle unresolved expressions in ExprMutationAnalyzer

2018-08-15 Thread Shuai Wang via Phabricator via cfe-commits
shuaiwang updated this revision to Diff 160952. shuaiwang marked 3 inline comments as done. shuaiwang added a comment. More test cases Repository: rCTE Clang Tools Extra https://reviews.llvm.org/D50619 Files: clang-tidy/utils/ExprMutationAnalyzer.cpp unittests/clang-tidy/ExprMutationAnal

[PATCH] D50619: [clang-tidy] Handle unresolved expressions in ExprMutationAnalyzer

2018-08-15 Thread Shuai Wang via Phabricator via cfe-commits
shuaiwang added inline comments. Comment at: unittests/clang-tidy/ExprMutationAnalyzerTest.cpp:410 + match(withEnclosingCompound(declRefTo("y")), AST->getASTContext()); + EXPECT_THAT(mutatedBy(ResultsY, AST.get()), ElementsAre("y")); +} JonasToth wrote: > O

[PATCH] D50619: [clang-tidy] Handle unresolved expressions in ExprMutationAnalyzer

2018-08-15 Thread Jonas Toth via Phabricator via cfe-commits
JonasToth added inline comments. Comment at: unittests/clang-tidy/ExprMutationAnalyzerTest.cpp:117 +TEST(ExprMutationAnalyzerTest, AssumedNonConstMemberFunc) { + auto AST = tooling::buildASTFromCode( I think you could add another test with `X x` (if you don't

[PATCH] D50619: [clang-tidy] Handle unresolved expressions in ExprMutationAnalyzer

2018-08-14 Thread Shuai Wang via Phabricator via cfe-commits
shuaiwang updated this revision to Diff 160694. shuaiwang marked 2 inline comments as done. shuaiwang added a comment. Herald added a subscriber: Szelethus. - Fix a few cases overlooked previously - More test cases Repository: rCTE Clang Tools Extra https://reviews.llvm.org/D50619 Files: c

[PATCH] D50619: [clang-tidy] Handle unresolved expressions in ExprMutationAnalyzer

2018-08-13 Thread Jonas Toth via Phabricator via cfe-commits
JonasToth added inline comments. Comment at: unittests/clang-tidy/ExprMutationAnalyzerTest.cpp:454 + + AST = + tooling::buildASTFromCode("template void f() { T x; x.y.z; }"); JonasToth wrote: > Is there already a test for a method from a templated type? >

[PATCH] D50619: [clang-tidy] Handle unresolved expressions in ExprMutationAnalyzer

2018-08-13 Thread Jonas Toth via Phabricator via cfe-commits
JonasToth added a comment. Please add a test for the same usecase as in Sema. template struct SizeIndicator { constexpr int value = 8; }; template <> struct SizeIndicator { constexpr int value = 4; }; template void fooFunction() { char Characters[SizeIndicator::value

[PATCH] D50619: [clang-tidy] Handle unresolved expressions in ExprMutationAnalyzer

2018-08-12 Thread Shuai Wang via Phabricator via cfe-commits
shuaiwang created this revision. shuaiwang added reviewers: aaron.ballman, JonasToth. Herald added subscribers: cfe-commits, a.sidorin, xazax.hun. Herald added a reviewer: george.karpenkov. - If a function is unresolved, assume it mutates its arguments - Follow unresolved member expressions for ne