[gcc r13-7994] libstdc++: [_GLIBCXX_INLINE_VERSION] Provide handle_contract_violation symbol

Francois Dumont fdumont@gcc.gnu.org
Mon Oct 30 21:27:15 GMT 2023


https://gcc.gnu.org/g:fa48423394a3456ebbecb11a503813fc8c0b5d52

commit r13-7994-gfa48423394a3456ebbecb11a503813fc8c0b5d52
Author: François Dumont <fdumont@gcc.gnu.org>
Date:   Tue Sep 19 18:56:57 2023 +0200

    libstdc++: [_GLIBCXX_INLINE_VERSION] Provide handle_contract_violation symbol
    
    libstdc++-v3/ChangeLog:
    
            * src/experimental/contract.cc
            [_GLIBCXX_INLINE_VERSION](handle_contract_violation): Provide symbol
            without version namespace decoration for gcc.

Diff:
---
 libstdc++-v3/src/experimental/contract.cc | 9 +++++++++
 1 file changed, 9 insertions(+)

diff --git a/libstdc++-v3/src/experimental/contract.cc b/libstdc++-v3/src/experimental/contract.cc
index 504a6c041f17..39ad4bd7d075 100644
--- a/libstdc++-v3/src/experimental/contract.cc
+++ b/libstdc++-v3/src/experimental/contract.cc
@@ -67,3 +67,12 @@ handle_contract_violation (const std::experimental::contract_violation &violatio
   std::cerr << std::endl;
 #endif
 }
+
+#if _GLIBCXX_INLINE_VERSION
+// The compiler expects the contract_violation class to be in an unversioned
+// namespace, so provide a forwarding function with the expected symbol name.
+extern "C" void
+_Z25handle_contract_violationRKNSt12experimental18contract_violationE
+(const std::experimental::contract_violation &violation)
+{ handle_contract_violation(violation); }
+#endif


More information about the Gcc-cvs mailing list