Commit fa57bfc5 by Dino Radakovic Committed by Copybara-Service

`absl/log/internal`: Document conditional ABSL_ATTRIBUTE_UNUSED, add C++17 TODO

Once absl's support floor moves to C++17, we'll be able to replace it with [`[[maybe_unused]]`](https://en.cppreference.com/w/cpp/language/attributes/maybe_unused).

PiperOrigin-RevId: 625680108
Change-Id: I823b70c0f833dcf9c41bca0c2566b12ec65785de
parent e304ff50
...@@ -31,6 +31,13 @@ ...@@ -31,6 +31,13 @@
// logging in subtly different ways for subtly different reasons (see below). // logging in subtly different ways for subtly different reasons (see below).
#if defined(STRIP_LOG) && STRIP_LOG #if defined(STRIP_LOG) && STRIP_LOG
// Attribute for marking variables used in implementation details of logging
// macros as unused, but only when `STRIP_LOG` is defined.
// With `STRIP_LOG` on, not marking them triggers `-Wunused-but-set-variable`,
// With `STRIP_LOG` off, marking them triggers `-Wused-but-marked-unused`.
//
// TODO(b/290784225): Replace this macro with attribute [[maybe_unused]] when
// Abseil stops supporting C++14.
#define ABSL_LOG_INTERNAL_ATTRIBUTE_UNUSED_IF_STRIP_LOG ABSL_ATTRIBUTE_UNUSED #define ABSL_LOG_INTERNAL_ATTRIBUTE_UNUSED_IF_STRIP_LOG ABSL_ATTRIBUTE_UNUSED
#define ABSL_LOGGING_INTERNAL_LOG_INFO ::absl::log_internal::NullStream() #define ABSL_LOGGING_INTERNAL_LOG_INFO ::absl::log_internal::NullStream()
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment