[cfe-dev] clang-format, recognizing alternative binary operator tokens

Richard Smith richard at metafoo.co.uk
Mon May 5 13:20:07 PDT 2014


On Mon, May 5, 2014 at 12:39 PM, Bobby Moretti <bobmoretti at gmail.com> wrote:

> Thanks everyone for the feedback.
>
> It sounds like folks are ok with enabling the keyword binary operators
> by default, and not adding a new option to clang-format.
>
> Do we want to enable this even if "Language" is not "Cpp" in the Style
> options?
>
> One thing that I find confusing: in the same function,
> LangOpts.CPlusPlus is always set to 1. Does this mean that
> clang-format always lexes all source files using C++ keywords? Even if
> they are C or ObjC files?
>
> I'd be happy to submit a patch, but I'd like to get the exact behavior
> nailed down beforehand, since I'm new to clang/llvm community.
>
> Also, FWIW, you can also keep MSVC happy with the operator keywords by
> passing /Za to the compiler.


Incidentally: that flag doesn't actually make MSVC handle these keywords
properly; they instead appear to be faked up by #defines (which in turn
breaks some versions of boost...)
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/cfe-dev/attachments/20140505/be1dfbd2/attachment.html>


More information about the cfe-dev mailing list