[PATCH] D39367: [clang-tidy] Add support for operator new[] in check bugprone-misplaced-operator-in-strlen-in-alloc

2017-11-23 Thread Balogh , Ádám via Phabricator via cfe-commits
baloghadamsoftware closed this revision. baloghadamsoftware added a comment. Closed by commit https://reviews.llvm.org/rL318912. https://reviews.llvm.org/D39367 ___ cfe-commits mailing list cfe-commits@lists.llvm.org

[PATCH] D39367: [clang-tidy] Add support for operator new[] in check bugprone-misplaced-operator-in-strlen-in-alloc

2017-11-06 Thread Balogh , Ádám via Phabricator via cfe-commits
baloghadamsoftware updated this revision to Diff 121691. baloghadamsoftware added a comment. Updated to match https://reviews.llvm.org/D39121. https://reviews.llvm.org/D39367 Files: clang-tidy/bugprone/MisplacedOperatorInStrlenInAllocCheck.cpp docs/ReleaseNotes.rst

[PATCH] D39367: [clang-tidy] Add support for operator new[] in check bugprone-misplaced-operator-in-strlen-in-alloc

2017-10-30 Thread Aaron Ballman via Phabricator via cfe-commits
aaron.ballman accepted this revision. aaron.ballman added a comment. This revision is now accepted and ready to land. LGTM https://reviews.llvm.org/D39367 ___ cfe-commits mailing list cfe-commits@lists.llvm.org

[PATCH] D39367: [clang-tidy] Add support for operator new[] in check bugprone-misplaced-operator-in-strlen-in-alloc

2017-10-30 Thread Balogh , Ádám via Phabricator via cfe-commits
baloghadamsoftware updated this revision to Diff 120776. baloghadamsoftware added a comment. Oops! Sorry! https://reviews.llvm.org/D39367 Files: clang-tidy/bugprone/MisplacedOperatorInStrlenInAllocCheck.cpp clang-tidy/bugprone/MisplacedOperatorInStrlenInAllocCheck.h docs/ReleaseNotes.rst

[PATCH] D39367: [clang-tidy] Add support for operator new[] in check bugprone-misplaced-operator-in-strlen-in-alloc

2017-10-27 Thread Aaron Ballman via Phabricator via cfe-commits
aaron.ballman added inline comments. Comment at: clang-tidy/bugprone/MisplacedOperatorInStrlenInAllocCheck.cpp:64-65 +Alloc = Result.Nodes.getNodeAs("Alloc"); + assert(Alloc && "Matched node bound by `Alloc` shoud be either `CallExpr`" + " or `CXXNewExpr`"); +

[PATCH] D39367: [clang-tidy] Add support for operator new[] in check bugprone-misplaced-operator-in-strlen-in-alloc

2017-10-27 Thread Balogh , Ádám via Phabricator via cfe-commits
baloghadamsoftware updated this revision to Diff 120595. baloghadamsoftware added a comment. Herald added a subscriber: mgorny. Backsticks changed to single quotes, new tests added. https://reviews.llvm.org/D39367 Files: clang-tidy/bugprone/BugproneTidyModule.cpp

[PATCH] D39367: [clang-tidy] Add support for operator new[] in check bugprone-misplaced-operator-in-strlen-in-alloc

2017-10-27 Thread Aaron Ballman via Phabricator via cfe-commits
aaron.ballman added inline comments. Comment at: clang-tidy/bugprone/MisplacedOperatorInStrlenInAllocCheck.cpp:64-65 +Alloc = Result.Nodes.getNodeAs("Alloc"); + assert(Alloc && "Matched node bound by `Alloc` shoud be either `CallExpr`" + " or `CXXNewExpr`"); +

[PATCH] D39367: [clang-tidy] Add support for operator new[] in check bugprone-misplaced-operator-in-strlen-in-alloc

2017-10-27 Thread Balogh , Ádám via Phabricator via cfe-commits
baloghadamsoftware marked an inline comment as done. baloghadamsoftware added a comment. In https://reviews.llvm.org/D39367#909117, @JonasToth wrote: > Should the release notes be modified as well? I think so. I consider the inclusion of operator `new[]` important.

[PATCH] D39367: [clang-tidy] Add support for operator new[] in check bugprone-misplaced-operator-in-strlen-in-alloc

2017-10-27 Thread Balogh , Ádám via Phabricator via cfe-commits
baloghadamsoftware updated this revision to Diff 120579. baloghadamsoftware added a comment. Reformatted according to the comments. https://reviews.llvm.org/D39367 Files: clang-tidy/bugprone/MisplacedOperatorInStrlenInAllocCheck.cpp docs/ReleaseNotes.rst

[PATCH] D39367: [clang-tidy] Add support for operator new[] in check bugprone-misplaced-operator-in-strlen-in-alloc

2017-10-27 Thread Jonas Toth via Phabricator via cfe-commits
JonasToth added a comment. Should the release notes be modified as well? Repository: rL LLVM https://reviews.llvm.org/D39367 ___ cfe-commits mailing list cfe-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[PATCH] D39367: [clang-tidy] Add support for operator new[] in check bugprone-misplaced-operator-in-strlen-in-alloc

2017-10-27 Thread Jonas Toth via Phabricator via cfe-commits
JonasToth added inline comments. Comment at: clang-tidy/bugprone/MisplacedOperatorInStrlenInAllocCheck.cpp:62 + const Expr *Alloc = Result.Nodes.getNodeAs("Alloc"); + if (!Alloc) Alloc = Result.Nodes.getNodeAs("Alloc"); const auto *StrLen = Result.Nodes.getNodeAs("StrLen");

[PATCH] D39367: [clang-tidy] Add support for operator new[] in check bugprone-misplaced-operator-in-strlen-in-alloc

2017-10-27 Thread Balogh , Ádám via Phabricator via cfe-commits
baloghadamsoftware created this revision. Herald added a subscriber: rnkovacs. The check now recognizes error cases like `new char[strlen(s + 1)]` and suggests a fix in the format `new char[strlen(s) + 1]`. https://reviews.llvm.org/D39367 Files: