The SD-6 draft has
[3.3.6] Example
This demonstrates a way to use the attribute [[deprecated]] only if it
is available.
#ifdef __has_cpp_attribute
# if __has_cpp_attribute(deprecated)
#define ATTR_DEPRECATED(msg) [[deprecated(msg)]]
# else
#define ATTR_DEPRECATED(msg)
# endif
#endif
On Wed, Oct 12, 2016 at 6:55 AM, Jonathan Wakely wrote:
> The SD-6 draft has
>
> [3.3.6] Example
>
> This demonstrates a way to use the attribute [[deprecated]] only if it
> is available.
>
> #ifdef __has_cpp_attribute
> # if __has_cpp_attribute(deprecated)
> #define ATTR_DEPRECATED(msg) [[de
On 12 October 2016 at 12:51, Aaron Ballman wrote:
> On Wed, Oct 12, 2016 at 6:55 AM, Jonathan Wakely wrote:
>> The SD-6 draft has
>>
>> [3.3.6] Example
>>
>> This demonstrates a way to use the attribute [[deprecated]] only if it
>> is available.
>>
>> #ifdef __has_cpp_attribute
>> # if __has_cpp
P0220R1 added std::sample from Library Fundamentals v1 to the WP, but
this isn't mentioned in SD-6.
I suggest adding __cpp_lib_sample to the P0220R1 section of the C++17 table.
[5.15.106] says that sample was omitted from P0220R1, but it wasn't
(see 12.3 in the proposal, and note that we only too
> This leaves ATTR_DEPRECATED undefined if the compiler doesn't
> support
> the __has_cpp_attribute macro, is that intended? Unless the idea is
> that some other method would be used to decide if it's available, it
> should be something like:
>
> #ifdef __has_cpp_attribute
> # if __has_cpp_attrib
On Wed, Oct 12, 2016 at 3:55 AM, Jonathan Wakely wrote:
> The SD-6 draft has
>
> [3.3.6] Example
>
> This demonstrates a way to use the attribute [[deprecated]] only if it
> is available.
>
> #ifdef __has_cpp_attribute
> # if __has_cpp_attribute(deprecated)
> #define ATTR_DEPRECATED(msg) [[d
> The usage model we've always documented for these __has_* macros in
> Clang is:
>
> #ifndef __has_cpp_attribute
> # define __has_cpp_attribute(x) 0
> #endif
>
> #if __has_cpp_attribute(deprecated)
> # define ATTR_DEPRECATED(msg) [[deprecated(msg)]]
> #else
>
> # define ATTR_DEPRECATED(msg)
>