Skip to content

Commit af4c589

Browse files
derekmaurocopybara-github
authored andcommitted
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
1 parent 074a32a commit af4c589

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

absl/base/attributes.h

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -816,8 +816,11 @@
816816
//
817817
// See also the upstream documentation:
818818
// https://clang.llvm.org/docs/AttributeReference.html#lifetimebound
819+
// https://learn.microsoft.com/en-us/cpp/code-quality/c26816?view=msvc-170
819820
#if ABSL_HAVE_CPP_ATTRIBUTE(clang::lifetimebound)
820821
#define ABSL_ATTRIBUTE_LIFETIME_BOUND [[clang::lifetimebound]]
822+
#elif ABSL_HAVE_CPP_ATTRIBUTE(msvc::lifetimebound)
823+
#define ABSL_ATTRIBUTE_LIFETIME_BOUND [[msvc::lifetimebound]]
821824
#elif ABSL_HAVE_ATTRIBUTE(lifetimebound)
822825
#define ABSL_ATTRIBUTE_LIFETIME_BOUND __attribute__((lifetimebound))
823826
#else

0 commit comments

Comments
 (0)