Commit 34e29aae by Chris Kennelly Committed by Copybara-Service

Add ABSL_ATTRIBUTE_NO_UNIQUE_ADDRESS helper.

PiperOrigin-RevId: 516245113
Change-Id: Idaef538c9392decbfdeb3ed3b3c109c795f92f4d
parent d8933b83
...@@ -779,4 +779,18 @@ ...@@ -779,4 +779,18 @@
#define ABSL_ATTRIBUTE_TRIVIAL_ABI #define ABSL_ATTRIBUTE_TRIVIAL_ABI
#endif #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_ #endif // ABSL_BASE_ATTRIBUTES_H_
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