Gabe Black has uploaded this change for review. ( https://gem5-review.googlesource.com/c/public/gem5/+/48506 )

Change subject: base: Deprecate the GEM5_FALLTHROUGH macro.
......................................................................

base: Deprecate the GEM5_FALLTHROUGH macro.

The [[fallthrough]] attribute is now standard.

Change-Id: I9ab115f0135256a701efaa9a6c7ba4e966283f4b
---
M src/base/compiler.hh
1 file changed, 3 insertions(+), 9 deletions(-)



diff --git a/src/base/compiler.hh b/src/base/compiler.hh
index 8fd3808..a153d91 100644
--- a/src/base/compiler.hh
+++ b/src/base/compiler.hh
@@ -52,15 +52,6 @@
  * Attributes that become standard in later versions of c++.
  */

-// Use GEM5_FALLTHROUGH to mark when you're intentionally falling through from
-// one case to another in a switch statement.
-#if __has_cpp_attribute(fallthrough) // Standard in c++17.
-#  define GEM5_FALLTHROUGH [[fallthrough]]
-#else
-// Not supported, so it's not necessary to avoid warnings.
-#  define GEM5_FALLTHROUGH
-#endif
-
// When the return value of a function should not be discarded, mark it with
 // GEM5_NO_DISCARD.
#if __has_cpp_attribute(nodiscard) // Standard in c++17, with message in c++20.
@@ -205,4 +196,7 @@
 #define M5_FOR_EACH_IN_PACK(...) GEM5_FOR_EACH_IN_PACK(__VA_ARGS__)
 #define M5_CLASS_VAR_USED GEM5_CLASS_VAR_USED

+#define GEM5_FALLTHROUGH GEM5_DEPRECATED_MACRO_STMT(GEM5_FALLTHROUGH,,\
+ "Please use the [[fallthrough]] attribute directly."); [[fallthrough]]
+
 #endif // __BASE_COMPILER_HH__

--
To view, visit https://gem5-review.googlesource.com/c/public/gem5/+/48506
To unsubscribe, or for help writing mail filters, visit https://gem5-review.googlesource.com/settings

Gerrit-Project: public/gem5
Gerrit-Branch: develop
Gerrit-Change-Id: I9ab115f0135256a701efaa9a6c7ba4e966283f4b
Gerrit-Change-Number: 48506
Gerrit-PatchSet: 1
Gerrit-Owner: Gabe Black <[email protected]>
Gerrit-MessageType: newchange
_______________________________________________
gem5-dev mailing list -- [email protected]
To unsubscribe send an email to [email protected]
%(web_page_url)slistinfo%(cgiext)s/%(_internal_name)s

Reply via email to