From af4c589ed6f312372bb02bfaacb62c14598ceb04 Mon Sep 17 00:00:00 2001 From: Derek Mauro Date: Sun, 7 Jul 2024 12:35:47 -0700 Subject: Add an MSVC implementation of ABSL_ATTRIBUTE_LIFETIME_BOUND https://learn.microsoft.com/en-us/cpp/code-quality/c26816?view=msvc-170 PiperOrigin-RevId: 650044473 Change-Id: I2bf31f1e4b972e890194d21c5a6dcb4ee9993484 --- absl/base/attributes.h | 3 +++ 1 file changed, 3 insertions(+) diff --git a/absl/base/attributes.h b/absl/base/attributes.h index 5acbdb6c..5ea5ee3e 100644 --- a/absl/base/attributes.h +++ b/absl/base/attributes.h @@ -816,8 +816,11 @@ // // See also the upstream documentation: // https://clang.llvm.org/docs/AttributeReference.html#lifetimebound +// https://learn.microsoft.com/en-us/cpp/code-quality/c26816?view=msvc-170 #if ABSL_HAVE_CPP_ATTRIBUTE(clang::lifetimebound) #define ABSL_ATTRIBUTE_LIFETIME_BOUND [[clang::lifetimebound]] +#elif ABSL_HAVE_CPP_ATTRIBUTE(msvc::lifetimebound) +#define ABSL_ATTRIBUTE_LIFETIME_BOUND [[msvc::lifetimebound]] #elif ABSL_HAVE_ATTRIBUTE(lifetimebound) #define ABSL_ATTRIBUTE_LIFETIME_BOUND __attribute__((lifetimebound)) #else -- cgit v1.2.3