]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
libstdc++: Ensure language linkage of std::__terminate()
authorJonathan Wakely <jwakely@redhat.com>
Wed, 13 Oct 2021 09:35:44 +0000 (10:35 +0100)
committerJonathan Wakely <jwakely@redhat.com>
Wed, 13 Oct 2021 09:42:45 +0000 (10:42 +0100)
This is needed because people still find it necessary to do:

  extern "C" {
  #include <stdlib.h>
  }

libstdc++-v3/ChangeLog:

* include/bits/c++config (__terminate): Add extern "C++".

libstdc++-v3/include/bits/c++config

index b76ffeb2562178727fbdc15424fe8600b7a88a6f..a64958096718126a49e8767694e913ed96108df2 100644 (file)
@@ -296,7 +296,7 @@ namespace std
 
   // This allows the library to terminate without including all of <exception>
   // and without making the declaration of std::terminate visible to users.
-  __attribute__ ((__noreturn__, __always_inline__))
+  extern "C++" __attribute__ ((__noreturn__, __always_inline__))
   inline void __terminate() _GLIBCXX_USE_NOEXCEPT
   {
     void terminate() _GLIBCXX_USE_NOEXCEPT __attribute__ ((__noreturn__));