[PATCH] Allow _MSC_EXTENSIONS macro on non-Windows targets
Yunzhong Gao
Yunzhong_Gao at playstation.sony.com
Fri Mar 14 21:02:07 PDT 2014
> 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).
In that case, something like the following should return true if the operator
token is to be recognized. Right?
bool isSpecialOperatorToken(IdentifierInfo *II)
{
if (LangOpts.MSVCCompat)
return false;
return II->isCPlusPlusOperatorKeyword();
}
> 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?").
True, but I would prefer if it is called something else.
All the other __has_***() methods return true if the given parameter is
something special, whereas it seems that __is_identifier() would return
false if something is special (hence not an identifier).
Maybe __has_special_token(parameter)?
http://llvm-reviews.chandlerc.com/D3034
More information about the cfe-commits
mailing list