[tint][utils] Use [[maybe_unused]] on TINT_STATIC_INIT
Prevents warnings about unused variables when used in a function.
Change-Id: I0ede54bd80910d43c7b2ddd005f6bc369d538344
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/154300
Kokoro: Kokoro <noreply+kokoro@google.com>
Reviewed-by: Antonio Maiorano <amaiorano@google.com>
Auto-Submit: Ben Clayton <bclayton@google.com>
diff --git a/src/tint/utils/macros/static_init.h b/src/tint/utils/macros/static_init.h
index 5896129..e1b69fb 100644
--- a/src/tint/utils/macros/static_init.h
+++ b/src/tint/utils/macros/static_init.h
@@ -22,10 +22,10 @@
/// For example: `TINT_STATIC_INIT(CallAtStartup(1,2,3));`
/// @note: This must not be used at global scope in production code, as this violates the Chromium
/// rules around static initializers. Attempting to do this will result in a compilation error.
-#define TINT_STATIC_INIT(STATEMENT) \
- static const bool TINT_CONCAT(tint_static_init_, __COUNTER__) = [] { \
- STATEMENT; \
- return true; \
+#define TINT_STATIC_INIT(STATEMENT) \
+ [[maybe_unused]] static const bool TINT_CONCAT(tint_static_init_, __COUNTER__) = [] { \
+ STATEMENT; \
+ return true; \
}()
#endif // SRC_TINT_UTILS_MACROS_STATIC_INIT_H_