libstdc++ PATCH to harmonize noexcept

Jonathan Wakely jwakely@redhat.com
Fri Dec 1 15:33:00 GMT 2017


On 14/11/17 13:56 -0500, Jason Merrill wrote:
>While working on an unrelated issue I noticed that the compiler didn't
>like some of these declarations after preprocessing, when they aren't
>protected by system-header permissiveness.
>
>I thought about limiting the permissiveness to only extern "C"
>functions, but I believe that system headers are adding more C++
>declarations, so we'd likely run into this issue again.
>
>Shouldn't we build libstdc++ with -Wsystem-headers?  Maybe along with
>-Wno-error=system-headers?
>
>Jonathan approved these changes elsewhere.
>
>Jason

>commit abe66184d116f85f10108191b081f48dd0cfe3aa
>Author: Jason Merrill <jason@redhat.com>
>Date:   Tue Nov 14 13:48:57 2017 -0500
>
>            Correct noexcept mismatch in declarations.
>
>            * include/bits/fs_ops.h (permissions): Add noexcept.
>            * include/bits/fs_fwd.h (copy, copy_file): Remove noexcept.
>            (permissions): Add noexcept.
>            * include/std/string_view (find_first_of): Add noexcept.
>

There's another one needed too:

--- a/libstdc++-v3/libsupc++/eh_throw.cc
+++ b/libstdc++-v3/libsupc++/eh_throw.cc
@@ -53,8 +53,10 @@ __gxx_exception_cleanup (_Unwind_Reason_Code code, _Unwind_Exception *exc)
 }
 
 extern "C" __cxa_refcounted_exception*
-__cxxabiv1::__cxa_init_primary_exception(void *obj, std::type_info *tinfo,
-                                         void (_GLIBCXX_CDTOR_CALLABI *dest) (void *))
+__cxxabiv1::
+__cxa_init_primary_exception(void *obj, std::type_info *tinfo,
+                            void (_GLIBCXX_CDTOR_CALLABI *dest) (void *))
+_GLIBCXX_NOTHROW
 {
   __cxa_refcounted_exception *header
     = __get_refcounted_exception_header_from_obj (obj);



More information about the Libstdc++ mailing list