[cfe-dev] Allowing '_' as version tuple separator?

jahanian fjahanian at apple.com
Thu Oct 2 09:54:28 PDT 2014


On Sep 30, 2014, at 3:57 PM, Douglas Gregor <dgregor at apple.com> wrote:

> 
>> On Sep 29, 2014, at 4:41 PM, jahanian <fjahanian at apple.com> wrote:
>> 
>> 
>>> Hi All,
>>> We have internal request to allow ‘_’ in addition to ‘.’ as version tuple separators.
>>> So, in addition to 'major[.minor[.subminor]]’, proposal is to allow ‘major[_minor[_subminor]]’
>>> as well. Is there a reason we shouldn’t do this?
> 
> There is some interaction with C++11 user-defined literals, because one can define (for example)
> 
> 	unsigned long long operator "" _0(unsigned long long x) { return -x; }
> 
> which makes “10_0” produce the value -10. However, Parser::ParseVersionTuple is already doing custom parsing of the numeric constant, so I think we’re okay… but be sure to run all of your tests in C++11, C++03, and C to be sure that none of our workaround or UDL logic gets in the way.

My change specifically impacts parsing version numbers for availability attributes only. Unless I misunderstood you, it should not have
impact on parsing any other construct.
In r218884.
- Fariborz
> 
> 	- Doug
> 
> 

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/cfe-dev/attachments/20141002/1de886af/attachment.html>


More information about the cfe-dev mailing list