base: Deprecate the GEM5_FALLTHROUGH macro.

The [[fallthrough]] attribute is now standard.

Change-Id: I9ab115f0135256a701efaa9a6c7ba4e966283f4b
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/48506
Reviewed-by: Daniel Carvalho <odanrc@yahoo.com.br>
Maintainer: Gabe Black <gabe.black@gmail.com>
Tested-by: kokoro <noreply+kokoro@google.com>
This commit is contained in:
Gabe Black
2021-07-23 22:52:25 -07:00
committed by Gabe Black
parent cb266a099f
commit 5590f2a903

View File

@@ -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 @@ do { GEM5_VAR_USED int i[] = { 0, ((void)(__VA_ARGS__), 0)... }; } while (0)
#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__