Re: [PATCH] D43120: [clang-tidy] New checker for exceptions that are created but not thrown

2018-02-15 Thread Roman Lebedev via cfe-commits
On Thu, Feb 15, 2018 at 3:48 PM, Aaron Ballman via cfe-commits wrote: > On Thu, Feb 15, 2018 at 4:11 AM, Phabricator via Phabricator > wrote: >> This revision was automatically updated to reflect the committed changes. >> Closed by commit

Re: [PATCH] D43120: [clang-tidy] New checker for exceptions that are created but not thrown

2018-02-15 Thread Aaron Ballman via cfe-commits
On Thu, Feb 15, 2018 at 4:11 AM, Phabricator via Phabricator wrote: > This revision was automatically updated to reflect the committed changes. > Closed by commit rL325222: [clang-tidy] New checker for exceptions that are > created but not thrown (authored by xazax,

[PATCH] D43120: [clang-tidy] New checker for exceptions that are created but not thrown

2018-02-15 Thread Phabricator via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rL325222: [clang-tidy] New checker for exceptions that are created but not thrown (authored by xazax, committed by ). Herald added subscribers: llvm-commits, klimek. Changed prior to commit:

[PATCH] D43120: [clang-tidy] New checker for exceptions that are created but not thrown

2018-02-14 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, thank you! https://reviews.llvm.org/D43120 ___ cfe-commits mailing list cfe-commits@lists.llvm.org

[PATCH] D43120: [clang-tidy] New checker for exceptions that are created but not thrown

2018-02-14 Thread Umann Kristóf via Phabricator via cfe-commits
Szelethus added a comment. Just noticed that I can't mark your inline comment as done, since the file got renamed. The typo is also fixed (Classname -> Class name). https://reviews.llvm.org/D43120 ___ cfe-commits mailing list

[PATCH] D43120: [clang-tidy] New checker for exceptions that are created but not thrown

2018-02-14 Thread Umann Kristóf via Phabricator via cfe-commits
Szelethus updated this revision to Diff 134174. Szelethus added a comment. Renamed the checker from `misc-throw-keyword-missing` to `bugprone-throw-keyword-missing`. https://reviews.llvm.org/D43120 Files: clang-tidy/bugprone/BugproneTidyModule.cpp clang-tidy/bugprone/CMakeLists.txt

[PATCH] D43120: [clang-tidy] New checker for exceptions that are created but not thrown

2018-02-13 Thread Aaron Ballman via Phabricator via cfe-commits
aaron.ballman requested changes to this revision. aaron.ballman added a comment. This revision now requires changes to proceed. I apologize for not noticing this important detail earlier -- I think this check should live under `bugprone` rather than `misc`. Other than where it lives (and the

[PATCH] D43120: [clang-tidy] New checker for exceptions that are created but not thrown

2018-02-13 Thread Umann Kristóf via Phabricator via cfe-commits
Szelethus updated this revision to Diff 134005. https://reviews.llvm.org/D43120 Files: clang-tidy/misc/CMakeLists.txt clang-tidy/misc/MiscTidyModule.cpp clang-tidy/misc/ThrowKeywordMissingCheck.cpp clang-tidy/misc/ThrowKeywordMissingCheck.h docs/ReleaseNotes.rst

[PATCH] D43120: [clang-tidy] New checker for exceptions that are created but not thrown

2018-02-12 Thread Aaron Ballman via Phabricator via cfe-commits
aaron.ballman added a comment. In https://reviews.llvm.org/D43120#1005100, @Szelethus wrote: > I also came up with this problem: > >RegularException funcReturningExceptioniTest(int i) { > return RegularException(); >} > >void returnedValueTest() { >

[PATCH] D43120: [clang-tidy] New checker for exceptions that are created but not thrown

2018-02-12 Thread Umann Kristóf via Phabricator via cfe-commits
Szelethus marked 7 inline comments as done. Szelethus added inline comments. Comment at: clang-tidy/misc/ThrowKeywordMissingCheck.cpp:45 + diag(TemporaryExpr->getLocStart(), + "exception instantiated but not bound (did you intend to 'throw'?)"); +}

[PATCH] D43120: [clang-tidy] New checker for exceptions that are created but not thrown

2018-02-12 Thread Umann Kristóf via Phabricator via cfe-commits
Szelethus updated this revision to Diff 133860. Szelethus added a comment. Fixed almost everything mentioned in comments. I also came up with this problem: RegularException funcReturningExceptioniTest(int i) { return RegularException(); } void returnedValueTest() {

[PATCH] D43120: [clang-tidy] New checker for exceptions that are created but not thrown

2018-02-09 Thread Aaron Ballman via Phabricator via cfe-commits
aaron.ballman added inline comments. Comment at: clang-tidy/misc/ThrowKeywordMissingCheck.cpp:24 + + auto CtorInitializerList = + cxxConstructorDecl(hasAnyConstructorInitializer(anything())); Eugene.Zelenko wrote: > Please don't use auto where type could

[PATCH] D43120: [clang-tidy] New checker for exceptions that are created but not thrown

2018-02-09 Thread Eugene Zelenko via Phabricator via cfe-commits
Eugene.Zelenko added inline comments. Comment at: clang-tidy/misc/ThrowKeywordMissingCheck.cpp:24 + + auto CtorInitializerList = + cxxConstructorDecl(hasAnyConstructorInitializer(anything())); Please don't use auto where type could not be easily deduced.

[PATCH] D43120: [clang-tidy] New checker for exceptions that are created but not thrown

2018-02-09 Thread Eugene Zelenko via Phabricator via cfe-commits
Eugene.Zelenko added inline comments. Comment at: docs/clang-tidy/checks/misc-throw-keyword-missing.rst:6 + +This check warns about the potentially missing `throw` keyword. If a temporary object is created, +but the object's type derives from (or the same as) a class that has

[PATCH] D43120: [clang-tidy] New checker for exceptions that are created but not thrown

2018-02-09 Thread Aaron Ballman via Phabricator via cfe-commits
aaron.ballman added a comment. One concern I have is with RAII objects with "exception" in the name. You may already properly handle this, but I'd like to see a test case like: struct ExceptionRAII { ExceptionRAII() {} ~ExceptionRAII() {} }; void foo() { ExceptionRAII E; //

[PATCH] D43120: [clang-tidy] New checker for exceptions that are created but not thrown

2018-02-09 Thread Whisperity via Phabricator via cfe-commits
whisperity resigned from this revision. whisperity added a comment. Works for me but I haven't any sayings in these.  https://reviews.llvm.org/D43120 ___ cfe-commits mailing list cfe-commits@lists.llvm.org

[PATCH] D43120: [clang-tidy] New checker for exceptions that are created but not thrown

2018-02-09 Thread Umann Kristóf via Phabricator via cfe-commits
Szelethus updated this revision to Diff 133600. Szelethus marked an inline comment as done. https://reviews.llvm.org/D43120 Files: clang-tidy/misc/CMakeLists.txt clang-tidy/misc/MiscTidyModule.cpp clang-tidy/misc/ThrowKeywordMissingCheck.cpp clang-tidy/misc/ThrowKeywordMissingCheck.h

[PATCH] D43120: [clang-tidy] New checker for exceptions that are created but not thrown

2018-02-09 Thread Umann Kristóf via Phabricator via cfe-commits
Szelethus marked 5 inline comments as done. Szelethus added inline comments. Comment at: clang-tidy/misc/ThrowKeywordMissingCheck.cpp:32 + hasType(cxxRecordDecl( + isSameOrDerivedFrom(matchesName("[Ee]xception|EXCEPTION", +

[PATCH] D43120: [clang-tidy] New checker for exceptions that are created but not thrown

2018-02-09 Thread Umann Kristóf via Phabricator via cfe-commits
Szelethus updated this revision to Diff 133597. Szelethus added a comment. Changes made according to @whisperity's comments. https://reviews.llvm.org/D43120 Files: clang-tidy/misc/CMakeLists.txt clang-tidy/misc/MiscTidyModule.cpp clang-tidy/misc/ThrowKeywordMissingCheck.cpp

[PATCH] D43120: [clang-tidy] New checker for exceptions that are created but not thrown

2018-02-09 Thread Whisperity via Phabricator via cfe-commits
whisperity requested changes to this revision. whisperity added inline comments. This revision now requires changes to proceed. Comment at: clang-tidy/misc/ThrowKeywordMissingCheck.cpp:21 +void ThrowKeywordMissingCheck::registerMatchers(MatchFinder *Finder) { + // This is a C++

[PATCH] D43120: [clang-tidy] New checker for exceptions that are created but not thrown

2018-02-09 Thread Umann Kristóf via Phabricator via cfe-commits
Szelethus created this revision. Szelethus added reviewers: cfe-commits, xazax.hun. Szelethus added a project: clang-tools-extra. Herald added subscribers: hintonda, rnkovacs, mgorny. New checker called misc-throw-keyword-missing warns about cases where a temporary object's type is (likely) an