Hint 0.1.0
Loading...
Searching...
No Matches
Macros
Attribute Detection

macros for determining supported attributes More...

Macros

#define hint_has_attribute(__x)   0
 __has_attribute(x)
 
#define hint_diagnose_if(condition, message)
 Reject a call when Clang can prove that its arguments violate a precondition.
 
#define hint_has_declspec_attribute(__x)   0
 portable __has_declspec_attribute(__x)
 
#define hint_empty_bases
 Allow multiple empty base subobjects to share storage under the MS ABI.
 

Detailed Description

macros for determining supported attributes

Macro Definition Documentation

◆ hint_diagnose_if

#define hint_diagnose_if (   condition,
  message 
)

Reject a call when Clang can prove that its arguments violate a precondition.

Place after the function declarator and any trailing requires clause. The condition can name parameters. An unknown condition leaves the call valid; this annotation adds no runtime check and does not affect overload selection.

◆ hint_empty_bases

#define hint_empty_bases

Allow multiple empty base subobjects to share storage under the MS ABI.

Without this attribute the MS ABI can allocate space for a second empty accessor base. Other ABIs keep their ordinary empty-base layout.

◆ hint_has_attribute

#define hint_has_attribute (   __x)    0

__has_attribute(x)

Used as the primary means for detecting advanced annotation features

◆ hint_has_declspec_attribute

#define hint_has_declspec_attribute (   __x)    0

portable __has_declspec_attribute(__x)

Defaults to 1 on MSVC, where we can assume __declspec(x) is well supported.

Uses the __has_declspec_attribute(x) implementation in Clang

Defaults to 0 otherwise.