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
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,
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:
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
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
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
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
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
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() {
>
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'?)");
+}
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() {
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
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.
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
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; //
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
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
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",
+
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
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++
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
21 matches
Mail list logo