This revision was automatically updated to reflect the committed changes.
Closed by commit rL325572: [clang-tidy] Replace the usage of
std::uncaught_exception with std… (authored by xazax, committed by ).
Herald added subscribers: llvm-commits, klimek.
Changed prior to commit:
koldaniel updated this revision to Diff 133814.
https://reviews.llvm.org/D40787
Files:
clang-tidy/modernize/CMakeLists.txt
clang-tidy/modernize/ModernizeTidyModule.cpp
clang-tidy/modernize/UseUncaughtExceptionsCheck.cpp
clang-tidy/modernize/UseUncaughtExceptionsCheck.h
aaron.ballman accepted this revision.
aaron.ballman added a comment.
This revision is now accepted and ready to land.
This LGTM with a few minor nits to fix.
Comment at: clang-tidy/modernize/ModernizeTidyModule.cpp:80-81
koldaniel updated this revision to Diff 132595.
https://reviews.llvm.org/D40787
Files:
clang-tidy/modernize/CMakeLists.txt
clang-tidy/modernize/ModernizeTidyModule.cpp
clang-tidy/modernize/UseUncaughtExceptionsCheck.cpp
clang-tidy/modernize/UseUncaughtExceptionsCheck.h
aaron.ballman added inline comments.
Comment at: test/clang-tidy/modernize-use-uncaught-exceptions.cpp:64
+ // CHECK-MESSAGES: [[@LINE-1]]:10: warning: 'std::uncaught_exception' is
deprecated, use 'std::uncaught_exceptions' instead
+ // CHECK-FIXES: foo = _exceptions;
+
koldaniel added inline comments.
Herald added a subscriber: hintonda.
Comment at: test/clang-tidy/modernize-use-uncaught-exceptions.cpp:64
+ // CHECK-MESSAGES: [[@LINE-1]]:10: warning: 'std::uncaught_exception' is
deprecated, use 'std::uncaught_exceptions' instead
+ //
aaron.ballman added inline comments.
Comment at: clang-tidy/modernize/UseUncaughtExceptionsCheck.cpp:45
+
+ if ((C = Result.Nodes.getNodeAs("call_expr"))) {
+BeginLoc = C->getLocStart();
Can remove spurious parens.
Comment at:
koldaniel updated this revision to Diff 130905.
https://reviews.llvm.org/D40787
Files:
clang-tidy/modernize/CMakeLists.txt
clang-tidy/modernize/ModernizeTidyModule.cpp
clang-tidy/modernize/UseUncaughtExceptionsCheck.cpp
clang-tidy/modernize/UseUncaughtExceptionsCheck.h
koldaniel added inline comments.
Comment at: clang-tidy/modernize/UseUncaughtExceptionsCheck.cpp:66-67
+}
+Diag << FixItHint::CreateInsertion(BeginLoc.getLocWithOffset(TextLength),
+ "s");
+ }
aaron.ballman wrote:
>
aaron.ballman added inline comments.
Comment at: clang-tidy/modernize/UseUncaughtExceptionsCheck.cpp:66-67
+}
+Diag << FixItHint::CreateInsertion(BeginLoc.getLocWithOffset(TextLength),
+ "s");
+ }
koldaniel wrote:
>
koldaniel added inline comments.
Comment at: clang-tidy/modernize/UseUncaughtExceptionsCheck.cpp:66-67
+}
+Diag << FixItHint::CreateInsertion(BeginLoc.getLocWithOffset(TextLength),
+ "s");
+ }
aaron.ballman wrote:
>
aaron.ballman added inline comments.
Comment at: clang-tidy/modernize/UseUncaughtExceptionsCheck.cpp:24
+
+ const char *MatchText = "::std::uncaught_exception";
+
You might as well make this a `std::string` rather than `const char *` because
the `hasName()`
koldaniel updated this revision to Diff 128390.
https://reviews.llvm.org/D40787
Files:
clang-tidy/modernize/CMakeLists.txt
clang-tidy/modernize/ModernizeTidyModule.cpp
clang-tidy/modernize/UseUncaughtExceptionsCheck.cpp
clang-tidy/modernize/UseUncaughtExceptionsCheck.h
aaron.ballman added inline comments.
Comment at: clang-tidy/modernize/ReplaceUncaughtExceptionCheck.cpp:59
+ if (!BeginLoc.isMacroID()) {
+Diag << FixItHint::CreateInsertion(BeginLoc.getLocWithOffset(TextLength),
+ "s");
xazax.hun added inline comments.
Comment at: clang-tidy/modernize/ReplaceUncaughtExceptionCheck.cpp:59
+ if (!BeginLoc.isMacroID()) {
+Diag << FixItHint::CreateInsertion(BeginLoc.getLocWithOffset(TextLength),
+ "s");
aaron.ballman added inline comments.
Comment at: clang-tidy/modernize/ReplaceUncaughtExceptionCheck.cpp:59
+ if (!BeginLoc.isMacroID()) {
+Diag << FixItHint::CreateInsertion(BeginLoc.getLocWithOffset(TextLength),
+ "s");
JonasToth added inline comments.
Comment at: clang-tidy/modernize/ReplaceUncaughtExceptionCheck.cpp:32
+ Finder->addMatcher(
+ declRefExpr(to(functionDecl(hasName(MatchText.bind("call_expr"),
+ this);
koldaniel wrote:
> JonasToth wrote:
> >
Eugene.Zelenko added a comment.
I think will be good idea to rename check to
//modernize-use-uncaught-exceptions// to be consistent with other similar
checks.
Please mention this check in docs/ReleaseNotes.rst (in alphabetical order).
Repository:
rCTE Clang Tools Extra
koldaniel added inline comments.
Comment at: clang-tidy/modernize/ReplaceUncaughtExceptionCheck.cpp:32
+ Finder->addMatcher(
+ declRefExpr(to(functionDecl(hasName(MatchText.bind("call_expr"),
+ this);
JonasToth wrote:
> Interesting. Did you
JonasToth added inline comments.
Comment at: clang-tidy/modernize/ReplaceUncaughtExceptionCheck.cpp:20
+
+static const char *MatchText = "::std::uncaught_exception";
+
Could that be a local variable in `registerMatchers`? Even though its static
and const it
20 matches
Mail list logo