C++ Logo

sg10

Advanced search

Re: [SG10] On __has_attribute

From: Jens Maurer <Jens.Maurer_at_[hidden]>
Date: Fri, 15 Aug 2014 21:44:50 +0200
On 08/15/2014 03:00 PM, Aaron Ballman wrote:
> On Thu, Mar 27, 2014 at 4:22 PM, Aaron Ballman <aaron_at_[hidden]> wrote:
>> Do we want to consider any ideas for attribute versioning? For
>> instance, say there was a desire to allow [[noreturn]] on a lambda.
>> With this proposal, there's no way to differentiate between versions
>> of the [[noreturn]] attribute. We could use a feature test macro, but
>> that's what this proposal really is.
>>
>> We could support this by changing the pp-number replacement (0 means
>> not found, > 0 supported, but you could check the constant value to
>> see what version is supported).
>
> Gently pinging this.
>
> Note: if it's a door we wish to leave open for the future, we could
> accomplish this with a minor wording modification to what we have
> already. Something like:
>
> The has-attribute-expression is replaced by <del>the pp-number
> 1</del><ins>a nonzero pp-number</ins> if the implementation supports
> an attribute with the specified name, and by the pp-number 0
> otherwise.

I believe we use year-month "version" numbers for other features,
and we should do the same for __has_cpp_attribute. (year-month
relates to the date a specification with that feature was
published)

I find this preferable to artificial 1,2,3 version numbers.

Jens

Received on 2014-08-15 21:50:26