[PATCH] D87627: [clang-tidy] Fix crash in modernize-use-noexcept on uninstantiated throw class
Aaron Ballman via Phabricator via cfe-commits
cfe-commits at lists.llvm.org
Tue Sep 15 05:12:56 PDT 2020
aaron.ballman added inline comments.
================
Comment at: clang-tools-extra/clang-tidy/modernize/UseNoexceptCheck.cpp:81
+ assert(FnTy && "FunctionProtoType is null.");
+ if (clang::isUnresolvedExceptionSpec(FnTy->getExceptionSpecType()))
+ return;
----------------
No need for the `clang::` bit.
================
Comment at: clang-tools-extra/test/clang-tidy/checkers/modernize-use-noexcept-opt.cpp:23
+// Shouldn't crash due to llvm_unreachable in canThrow() on EST_Uninstantiated
+template <int> class c { void *operator new(size_t) throw (int);};
+void s() { c<1> doesnt_crash; }
----------------
njames93 wrote:
> This line is causing tests to fail
Another suggestion is to do: `using size_t = decltype(sizeof(0));` at the top of the file.
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D87627/new/
https://reviews.llvm.org/D87627
More information about the cfe-commits
mailing list