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

Douglas Gregor dgregor at apple.com
Tue Sep 30 15:57:31 PDT 2014


> 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.

	- Doug


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/cfe-dev/attachments/20140930/7b40deb1/attachment.html>


More information about the cfe-dev mailing list