[PATCH] D34002: [clang-tidy] When" -fno-exceptions is used", this warning is better to be suppressed.

Alexander Kornienko via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Thu Jun 8 15:24:04 PDT 2017


alexfh added a comment.

In https://reviews.llvm.org/D34002#776193, @chh wrote:

> In https://reviews.llvm.org/D34002#775830, @alexfh wrote:
>
> > IIUC, when `vector<T>` (for a class `T` that has both move and copy constructors) resizes, it will prefer move constructors, but only if they're declared `noexcept`.  This is true even if `-fno-exceptions` is on. So I don't think this check should depend on `-fno-exceptions`.
>
>
> Should the compiler assume `noexcept` when -fno-exceptions is on?
>  That means move constructors should be preferred under -fno-exceptions, and this check would be unnecessary, right?


The compiler doesn't assume `noexcept` and I heard from competent people the reasons why it shouldn't, though I can't immediately recall these reasons. I think, the patch should be reverted.


https://reviews.llvm.org/D34002





More information about the cfe-commits mailing list