summaryrefslogtreecommitdiff
path: root/absl/base
diff options
context:
space:
mode:
authorGravatar Abseil Team <absl-team@google.com>2021-03-24 18:51:51 -0700
committerGravatar Derek Mauro <dmauro@google.com>2021-03-25 11:05:20 -0400
commita09b5de0d57d7b2179210989ab63361c3c1894f5 (patch)
tree54987b10801ee723d0641e6385e34e2f69feb528 /absl/base
parent1fdbe1ea1b8c835c11ed6fbec4d4259ad104f765 (diff)
Export of internal Abseil changes
-- 3de7250f2988e360764479fa590d299a649987c0 by Derek Mauro <dmauro@google.com>: Make the SOVERSION fit into 16 bits to make the MacOS linker happy PiperOrigin-RevId: 364939757 -- dead27aa0734a89ccb25da807e08e61000a47f8f by Abseil Team <absl-team@google.com>: Update `ABSL_ATTRIBUTE_UNUSED`'s documentation that `[[maybe_unused]]` in C++17 and up is now the preferred usage solution. Also document why we can't update `ABSL_ATTRIBUTE_UNUSED` to use `[[maybe_unused]]` (differences in positioning requirements). PiperOrigin-RevId: 364900016 -- 0baf1b01dc9a2b5f9869ff5a52a1cf7a032055a3 by Abseil Team <absl-team@google.com>: Slightly weaken the spec for `absl::string_view::compare` to match C++17. The Abseil-specific implementation provides a stronger guarantee than required by `std::string_view`, returning +1, 0, or -1. When `absl::string_view` is an alias for `std::string_view`, these are only guaranteed to be positive, zero, and negative. Portable code should not depend on the stronger guarantee. PiperOrigin-RevId: 364846419 GitOrigin-RevId: 3de7250f2988e360764479fa590d299a649987c0 Change-Id: I7c74004fc38c9f5eaad5b104a993b79518497c5b
Diffstat (limited to 'absl/base')
-rw-r--r--absl/base/attributes.h7
1 files changed, 7 insertions, 0 deletions
diff --git a/absl/base/attributes.h b/absl/base/attributes.h
index cf2cb550..4a8581e1 100644
--- a/absl/base/attributes.h
+++ b/absl/base/attributes.h
@@ -524,6 +524,13 @@
// ABSL_ATTRIBUTE_UNUSED
//
// Prevents the compiler from complaining about variables that appear unused.
+//
+// For code or headers that are assured to only build with C++17 and up, prefer
+// just using the standard '[[maybe_unused]]' directly over this macro.
+//
+// Due to differences in positioning requirements between the old, compiler
+// specific __attribute__ syntax and the now standard [[maybe_unused]], this
+// macro does not attempt to take advantage of '[[maybe_unused]]'.
#if ABSL_HAVE_ATTRIBUTE(unused) || (defined(__GNUC__) && !defined(__clang__))
#undef ABSL_ATTRIBUTE_UNUSED
#define ABSL_ATTRIBUTE_UNUSED __attribute__((__unused__))