This is an archive of the discontinued LLVM Phabricator instance.

[clang-format] Fixed missing space between Obj-C for/in and a typecast
ClosedPublic

Authored by ksuther on Aug 31 2015, 1:07 AM.

Details

Reviewers
djasper
Summary

Fixes this bug: https://llvm.org/bugs/show_bug.cgi?id=24504

TokenAnnotator::spaceRequiredBetween was handling TT_ForEachMacro but not TT_ObjCForIn, so lines that look like:

for (id nextObject in (NSArray *)myArray)

would incorrectly turn into:

for (id nextObject in(NSArray *)myArray)

Diff Detail

Event Timeline

ksuther updated this revision to Diff 33560.Aug 31 2015, 1:07 AM
ksuther retitled this revision from to [clang-format] Fixed missing space between Obj-C for/in and a typecast.
ksuther updated this object.

This is my first commit and I'm trying to figure out the system, hope I'm doing this right.

klimek added a comment.Sep 3 2015, 8:37 AM

In the future, please add cfe-commits as subscriber on the initial post, otherwise the initial email will not go to the mailing list. Thx!

klimek added a comment.Sep 3 2015, 8:38 AM

Oh, and you'll want to add tests :) unittests/Format/FormatTest.cpp

ksuther updated this revision to Diff 33947.Sep 3 2015, 9:11 AM

Added two tests: One of a for/in loop with a cast, and one without.

Adding another comment in hopes of getting some visibility on this. Do I need to add other people as reviewers?

djasper accepted this revision.Sep 22 2015, 2:43 AM
djasper edited edge metadata.

Looks good. Do you have commit access?

This revision is now accepted and ready to land.Sep 22 2015, 2:43 AM

I don't, this and http://reviews.llvm.org/D12489 are my first patch submissions.

djasper closed this revision.Oct 7 2015, 8:11 AM

Submitted as r249553. Sorry for the delay.