From 4030b720a987c1ce9a1c17cb76f5a9abd083cd43 Mon Sep 17 00:00:00 2001 From: Gabe Black Date: Tue, 18 May 2021 17:38:07 -0700 Subject: [PATCH] base: Avoid an unused expression error in GEM5_DEPRECATED_MACRO. If the lambda in that macro is not actually called, clang complains about an unused expression which breaks the build. Change-Id: Id8708944cbac4c937e833583da0c2c18422230c0 Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/45719 Reviewed-by: Daniel Carvalho Maintainer: Bobby R. Bruce Tested-by: kokoro --- src/base/compiler.hh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/base/compiler.hh b/src/base/compiler.hh index ba2a4bc4a8..17124bebe4 100644 --- a/src/base/compiler.hh +++ b/src/base/compiler.hh @@ -132,7 +132,7 @@ // The definition must be an c++ expression and not a statement because of how // the original macro is wrapped. # define GEM5_DEPRECATED_MACRO(name, definition, message) \ - ([](){GEM5_DEPRECATED(message) int name{}; return name;}, (definition)) + ([](){GEM5_DEPRECATED(message) int name{}; return name;}(), (definition)) // This version is for macros which are statement-like, which frequently use // "do {} while (0)" to make their syntax look more like normal c++ statements. # define GEM5_DEPRECATED_MACRO_STMT(name, definition, message) \