[libcxx-commits] [libcxx] [libc++] Document the strengthened noexcept convention (PR #203869)
A. Jiang via libcxx-commits
libcxx-commits at lists.llvm.org
Thu Jun 18 02:52:18 PDT 2026
frederick-vs-ja wrote:
> > > since they don't tell me how the `noexcept` is strengthened.
> >
> >
> > It's rarely meaningful to tell how the `noexcept` is strengthened. Exception specifications are almost always strengthened from "nothing" (implicit `noexcept(false)`) to `noexcept` or `noexcept(Cond)`.
> > The only meaningful cases I know are exception specifications relying on `allocator_traits<A>::propagate_on_container_swap::value` in the standard. We seem to be allowed to strengthen them to unconditional `noexcept` (if not, there should certainly be an LWG issue), and MSVC STL is already doing this.
>
> I don't really know what point you're trying to make? The qualifiers you've added clearly mean that you can't assume there wasn't already something specified in the standard, so I do think it's meaningful to say how we strengthened the `noexcept`.
I'm not against saying how we strengthened the `noexcept` where the standard is already specifying `noexcept(Cond)`, and I think it would be more helpful to say so if the standard specifies `noexcept(Cond)` and we strengthen it to `noexcept(Cond || OtherCond)`.
But such cases seem to be rare, and I'm a bit against saying how we strengthened the `noexcept` elsewhere.
https://github.com/llvm/llvm-project/pull/203869
More information about the libcxx-commits
mailing list