The issue is that for array subscript like:
arr[[Foo() bar]];
ClangFormat will recognize it as C++11 attribute syntax and put a space between 'arr' and first '[', like:
arr [[Foo() bar]];
Now it is fixed. Tested with:
ninja FormatTests
Paths
| Differential D54288
Fix ClangFormat issue of recognizing ObjC subscript as C++ attributes when message target is a result of a C-style method. ClosedPublic Authored by Wizard on Nov 8 2018, 6:41 PM.
Details Summary The issue is that for array subscript like: arr[[Foo() bar]]; ClangFormat will recognize it as C++11 attribute syntax and put a space between 'arr' and first '[', like: arr [[Foo() bar]]; Now it is fixed. Tested with: ninja FormatTests
Diff Detail
Event TimelineWizard retitled this revision from Fix ClangFormat issue of recognizing ObjC subscription as C++ attributes when message target is a result of a C-style method. to Fix ClangFormat issue of recognizing ObjC subscript as C++ attributes when message target is a result of a C-style method..Nov 8 2018, 6:46 PM This revision is now accepted and ready to land.Nov 9 2018, 3:05 PM Closed by commit rC346566: Fix ClangFormat issue of recognizing ObjC subscript as C++ attributes when… (authored by Wizard). · Explain WhyNov 9 2018, 3:21 PM Closed by commit rL346566: Fix ClangFormat issue of recognizing ObjC subscript as C++ attributes when… (authored by Wizard). · Explain Why This revision was automatically updated to reflect the committed changes. This revision was automatically updated to reflect the committed changes.
Revision Contents
Diff 173257 lib/Format/TokenAnnotator.cpp
unittests/Format/FormatTest.cpp
|