From 0bd2cfaf53b736189bea98888edcde0ab0051ddf Mon Sep 17 00:00:00 2001 From: "Bobby R. Bruce" Date: Wed, 18 Sep 2024 00:36:05 -0700 Subject: [PATCH] systemc: Disable 'overloaded-virtual' warn for systemc bind funcs For GCC >=v13 systemc was breaking due to the overloaded virtual warning check. Issue: #1121 --- src/systemc/ext/tlm_core/2/sockets/target_socket.hh | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/src/systemc/ext/tlm_core/2/sockets/target_socket.hh b/src/systemc/ext/tlm_core/2/sockets/target_socket.hh index 5a0e5ff9ef..5da81d892e 100644 --- a/src/systemc/ext/tlm_core/2/sockets/target_socket.hh +++ b/src/systemc/ext/tlm_core/2/sockets/target_socket.hh @@ -91,6 +91,17 @@ class tlm_base_target_socket : // - Binds the port of the target socket to the export of the initiator // socket // + +#pragma GCC diagnostic push +/** + * The following warning is disabled because the bind methods are overloaded + * in the derived class and the base class. In GCC v13+ this + * 'overloaded-virtual' warning is strict enough to trigger here (though the + * code is correct). + */ +#if defined(__GNUC__) && (__GNUC__ >= 13) +#pragma GCC diagnostic ignored "-Woverloaded-virtual" +#endif virtual void bind(base_initiator_socket_type &s) { @@ -133,6 +144,7 @@ class tlm_base_target_socket : } void operator () (fw_interface_type &s) { bind(s); } +#pragma GCC diagnostic pop // // Forward to 'size()' of port class.