[PATCH] Allow _MSC_EXTENSIONS macro on non-Windows targets
Richard Smith
richard at metafoo.co.uk
Fri Mar 14 17:57:43 PDT 2014
On Fri, Mar 14, 2014 at 5:31 PM, Yunzhong Gao <
Yunzhong_Gao at playstation.sony.com> wrote:
>
> I do not know. Are these alternative tokens pretty much set or are we
> expecting to add more in the future?
They're a fixed set, as defined by the C++ standard. It's unlikely that any
more will be added.
> Are
> they recognized as keywords only under MSVC compat mode?
>
They're not keywords, they're weird ways of spelling things like && and |.
Under MSVC compat mode, we should not recognize them at all (MSVC doesn't
do so in its default mode, and appears to treat them as macros in its
"conforming" mode).
> I guess we could have another __has_operator_token() test, but I can be
> convinced to rename __has_keyword()
> to mean any (non-attribute) special tokens.
>
You could instead provide an __is_identifier, which I think might be what
you're really looking for here ("is this token usable as an identifier?").
> Also, this proposed implementation is not testing those objective-c "at"
> keywords (only a keyword if after an "@"
> in objc mode). I am not sure if this is a problem.
I don't think that's a problem; that's a distinct namespace from the normal
identifier/keyword/alternative token one.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20140314/1f7b4097/attachment.html>
More information about the cfe-commits
mailing list