[PATCH] D86892: Improve error handling for SmallVector programming errors.
Geoffrey Martin-Noble via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Mon Aug 31 16:47:36 PDT 2020
GMNGeoffrey added a comment.
In D86892#2248345 <https://reviews.llvm.org/D86892#2248345>, @MaskRay wrote:
> `std::throw_length_error(char const*)` is indeed more appropriate if we intend to match the standard interface. Since we also need to work in the absence of exceptions, `report_fatal_error` seems good as an alternative.
Agreed. I didn't find anywhere in LLVM that throws a length error. I'm actually not very familiar with C++ exceptions, since I never use them. It looks like `LLVM_ENABLE_EXCEPTIONS` isn't used much, so not sure whether it should be here? I've modified the patch to use it. Maybe this would warrant a `report_length_error` similar to `report_bad_alloc_error` in ErrorHandling?
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D86892/new/
https://reviews.llvm.org/D86892
More information about the llvm-commits
mailing list