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

Bobby Moretti bobmoretti at gmail.com
Tue May 6 20:51:51 PDT 2014


Patch submitted to phabricator at http://reviews.llvm.org/D3634.

On Mon, May 5, 2014 at 1:20 PM, Richard Smith <richard at metafoo.co.uk> wrote:
> 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...)



-- 
Bobby Moretti
bobmoretti at gmail.com



More information about the cfe-dev mailing list