On Fri, 11 Jul 2025 at 14:21, Jakub Jelinek <ja...@redhat.com> wrote: > > On Fri, Jul 11, 2025 at 02:11:05PM +0100, Jonathan Wakely wrote: > > On Fri, 11 Jul 2025 at 14:02, Jonathan Wakely <jwak...@redhat.com> wrote: > > > > > > The if-consteval branches in std::make_exception_ptr and > > > std::exception_ptr_cast use a try-catch block, which gives an error for > > > -fno-exceptions. Just make them return a null pointer at compile-time > > > when -fno-exceptions is used, because there's no way to get an active > > > exception with -fno-exceptions. > > > > > > For std::exception_ptr_cast the consteval branch doesn't depend on RTTI > > > being enabled, so we can move the check for __cpp_rtti into the runtime > > > branch. We can also remove the #else group and just fall through to the > > > return nullptr statement if there was no return from whichever branch of > > > the if-consteval was taken. > > > > Actually for exception_ptr_cast maybe we want: > > > > #ifdef __cpp_rtti > > if not consteval { > > Agreed, just I think not is never used in libstdc++ headers, while > if !consteval { > is.
Yes, to work with -fno-operator-names