From f11227b4a09bedcc92b961d70f47b232095dbce7 Mon Sep 17 00:00:00 2001 From: Yu-Cheng Chang Date: Tue, 14 Nov 2023 19:54:35 +0800 Subject: [PATCH] systemc: Fix gcc13 systemC compilation error (#520) issue: https://github.com/gem5/gem5/issues/472 --- src/systemc/ext/core/sc_port.hh | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/systemc/ext/core/sc_port.hh b/src/systemc/ext/core/sc_port.hh index 796950e29b..bd57553559 100644 --- a/src/systemc/ext/core/sc_port.hh +++ b/src/systemc/ext/core/sc_port.hh @@ -114,6 +114,10 @@ class sc_port_base : public sc_object virtual sc_port_policy _portPolicy() const = 0; }; +// The overloaded virtual is intended in SystemC, so we'll disable the warning. +// Please check section 9.3 of SystemC 2.3.1 release note for more details. +#pragma GCC diagnostic push +#pragma GCC diagnostic ignored "-Woverloaded-virtual" template class sc_port_b : public sc_port_base { @@ -244,6 +248,7 @@ class sc_port_b : public sc_port_base sc_port_b(const sc_port_b &) {} sc_port_b &operator = (const sc_port_b &) { return *this; } }; +#pragma GCC diagnostic pop template class sc_port : public sc_port_b