https://gcc.gnu.org/bugzilla/show_bug.cgi?id=88840

--- Comment #2 from Jonathan Wakely <redi at gcc dot gnu.org> ---
LLVM seems to hit a case where this matters, and I'm not sure if it's invalid
yet:
https://bugzilla.opensuse.org/show_bug.cgi?id=1121591

The __use_relocate member of std::vector will check the exception-specification
without checking if the expression is even valid at all:

#if __cplusplus >= 201103L
      static constexpr bool __use_relocate =
        noexcept(std::__relocate_a(std::declval<pointer>(),
                                   std::declval<pointer>(),
                                   std::declval<pointer>(),
                                   std::declval<_Tp_alloc_type&>()));
#endif

If something depends on that boolean in a context where it isn't going to
relocate, we might get an error from the ill-formed signature.

We might want to only check that noexcept expression if the type is move
constructible.

Reply via email to