From 4bcdc749f85e44a99c50ac9cd7249fcc3fd9431c Mon Sep 17 00:00:00 2001 From: Yedidya Feldblum Date: Sat, 5 Oct 2024 14:26:59 -0700 Subject: [PATCH] FOLLY_ATTR_CLANG_UNINITIALIZED Summary: A preprocessor macro `FOLLY_ATTR_CLANG_UNINITIALIZED` expanding to `clang::uninitialized` when available. Reviewed By: dmm-fb Differential Revision: D63917336 fbshipit-source-id: 4fb08d15b29a6ed157d74eedab87b36515cdb67c --- folly/CppAttributes.h | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/folly/CppAttributes.h b/folly/CppAttributes.h index 14d3386fd1a..3400f859322 100644 --- a/folly/CppAttributes.h +++ b/folly/CppAttributes.h @@ -128,6 +128,12 @@ #define FOLLY_ATTR_CLANG_NO_DESTROY #endif +#if FOLLY_HAS_CPP_ATTRIBUTE(clang::uninitialized) +#define FOLLY_ATTR_CLANG_UNINITIALIZED clang::uninitialized +#else +#define FOLLY_ATTR_CLANG_UNINITIALIZED +#endif + /** * Accesses to objects with types with this attribute are not subjected to * type-based alias analysis, but are instead assumed to be able to alias any