summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--absl/base/attributes.h14
1 files changed, 14 insertions, 0 deletions
diff --git a/absl/base/attributes.h b/absl/base/attributes.h
index b7826e77..91bf954b 100644
--- a/absl/base/attributes.h
+++ b/absl/base/attributes.h
@@ -779,4 +779,18 @@
#define ABSL_ATTRIBUTE_TRIVIAL_ABI
#endif
+// ABSL_ATTRIBUTE_NO_UNIQUE_ADDRESS
+//
+// Indicates a data member can be optimized to occupy no space (if it is empty)
+// and/or its tail padding can be used for other members.
+//
+// For code that is assured to only build with C++20 or later, prefer using
+// the standard attribute `[[no_unique_address]]` directly instead of this
+// macro.
+#if ABSL_HAVE_CPP_ATTRIBUTE(no_unique_address)
+#define ABSL_ATTRIBUTE_NO_UNIQUE_ADDRESS [[no_unique_address]]
+#else
+#define ABSL_ATTRIBUTE_NO_UNIQUE_ADDRESS
+#endif
+
#endif // ABSL_BASE_ATTRIBUTES_H_