Commit 6ce98b52 authored by Nikita Lutsenko's avatar Nikita Lutsenko Committed by Facebook GitHub Bot

folly | CppAttributes | Add portable version of FOLLY_ATTR_MAY_ALIAS, to allow...

folly | CppAttributes | Add portable version of FOLLY_ATTR_MAY_ALIAS, to allow for usage across compilers.

Summary: This attribute is GCC/Clang specific, allow portable usage, well, via portability header and custom define.

Reviewed By: yfeldblum

Differential Revision: D30296807

fbshipit-source-id: bf496574139f42b07a11d582dedf6bac733318ec
parent ccf98845
......@@ -155,3 +155,14 @@
#else
#define FOLLY_ATTR_NO_UNIQUE_ADDRESS
#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
* other type of objects, just like the char type.
*/
#if FOLLY_HAS_CPP_ATTRIBUTE(gnu::may_alias)
#define FOLLY_ATTR_MAY_ALIAS [[gnu::may_alias]]
#else
#define FOLLY_ATTR_MAY_ALIAS
#endif
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