https://gcc.gnu.org/g:7038750f383a330e6cac96e44533e7a4bd9a34d7

commit r17-6515-g7038750f383a330e6cac96e44533e7a4bd9a34d7
Author: Thomas Schwinge <[email protected]>
Date:   Sat Nov 7 11:47:24 2026 +0100

    libstdc++: Deprecate std::unexpected and handler functions: Adjust 
'libstdc++-v3/libsupc++/eh_call.cc'
    
    In a '--enable-werror' build for '--target=arm-rtems6', in a
    '#ifdef __ARM_EABI_UNWINDER__' block of code, I ran into:
    
        ../../../../source-gcc/libstdc++-v3/libsupc++/eh_call.cc: In function 
‘void __cxa_call_unexpected(void*)’:
        ../../../../source-gcc/libstdc++-v3/libsupc++/eh_call.cc:112:24: error: 
‘void std::unexpected()’ is deprecated [-Werror=deprecated-declarations]
          112 |         std::unexpected();
              |         ~~~~~~~~~~~~~~~^~
        In file included from 
../../../../source-gcc/libstdc++-v3/libsupc++/unwind-cxx.h:34,
                         from 
../../../../source-gcc/libstdc++-v3/libsupc++/eh_call.cc:28:
        [...]/source-gcc/libstdc++-v3/libsupc++/exception:126:8: note: declared 
here
          126 |   void unexpected() __attribute__ ((__noreturn__,__cold__));
              |        ^~~~~~~~~~
        cc1plus: all warnings being treated as errors
    
    Mute this 'error: ‘void std::unexpected()’ is deprecated' in the same way as
    similar code had gotten in commit f4130a3eb545ab1aaf3ecb44f3d06b43e3751e04
    "libstdc++: Deprecate std::unexpected and handler functions".
    
            libstdc++-v3/
            * libsupc++/eh_call.cc [__ARM_EABI_UNWINDER__]: Disable deprecated
            warnings.

Diff:
---
 libstdc++-v3/libsupc++/eh_call.cc | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)

diff --git a/libstdc++-v3/libsupc++/eh_call.cc 
b/libstdc++-v3/libsupc++/eh_call.cc
index 5bc92f9c633a..a4ddd4ba34c4 100644
--- a/libstdc++-v3/libsupc++/eh_call.cc
+++ b/libstdc++-v3/libsupc++/eh_call.cc
@@ -109,7 +109,12 @@ __cxa_call_unexpected(void* exc_obj_in)
   __try
     {
       if (foreign_exception)
-       std::unexpected();
+       {
+#pragma GCC diagnostic push
+#pragma GCC diagnostic ignored "-Wdeprecated-declarations"
+         std::unexpected();
+#pragma GCC diagnostic pop
+       }
       else
        __unexpected(unexpectedHandler);
     }

Reply via email to