From 3420f0e223888bf70cd502efb5a534e651891b5c Mon Sep 17 00:00:00 2001 From: Gabe Black Date: Sun, 7 Oct 2018 03:59:56 -0700 Subject: systemc: Don't depend on the order of static initializers. STL containers may need to be constructed before they're used. Don't count on being able to insert into them during a static initializer. Change-Id: Icb05d5084a470e1ebd976ae6e1954b1a78aabd6a Reviewed-on: https://gem5-review.googlesource.com/c/13329 Reviewed-by: Gabe Black Maintainer: Gabe Black --- src/systemc/utils/report.hh | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'src/systemc/utils/report.hh') diff --git a/src/systemc/utils/report.hh b/src/systemc/utils/report.hh index ddbf62fa5..a0840c65b 100644 --- a/src/systemc/utils/report.hh +++ b/src/systemc/utils/report.hh @@ -110,8 +110,17 @@ extern bool reportWarningsAsErrors; struct DefaultReportMessages { + protected: + static DefaultReportMessages *&top(); + DefaultReportMessages *next; + + std::initializer_list> msgs; + void install(); + public: DefaultReportMessages(std::initializer_list>); + + static void installAll(); }; } // namespace sc_gem5 -- cgit v1.2.3