Boost logo

Boost :

Subject: Re: [boost] clang type traits
From: Doug Gregor (doug.gregor_at_[hidden])
Date: 2011-06-13 15:56:46


On Mon, Jun 13, 2011 at 12:47 PM, Daniel James <dnljms_at_[hidden]> wrote:
> On 13 June 2011 20:33, Doug Gregor <doug.gregor_at_[hidden]> wrote:
>> On Sun, Jun 12, 2011 at 4:27 AM, Daniel James <dnljms_at_[hidden]> wrote:
>>> On 10 June 2011 18:13, Doug Gregor <doug.gregor_at_[hidden]> wrote:
>>>>
>>>> For Clang feature tests, please use __has_feature (or the newer
>>>> __has_extension) rather than peeking at Clang version numbers.
>>>> __has_feature/__has_extension are language-dialect aware and represent
>>>> what the compiler actually supports, while Clang version numbers can
>>>> vary widely from one vendor to another (e.g., Apple's version numbers
>>>> for its Clang-based compilers are distinct from the LLVM project's
>>>> version numbers for Clang).
>>>
>>> Can we distinguish between Apple's versions and LLVM's versions?
>>
>> __APPLE_CC__ will say whether we're running on Darwin, but otherwise, no.
>
> That will a problem for working around bugs.

Theoretically, yes. If it becomes a practical problem, we'll deal with it.

> Anyway, I think this means the type traits change is incorrect. Since
> this is for a version of clang that won't be released for some time,
> it's probably best to revert it in the release branch.

I don't know which type-traits changes you're referring to. If the
intent is to pick up Clang's built-ins, then __has_feature is the way
to detect which built-ins are available regardless of Clang version.

  - Doug


Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk