djasper accepted this revision.
djasper added inline comments.
Comment at: lib/Format/TokenAnnotator.cpp:1347
+ } else if (Current.isOneOf(tok::identifier, tok::kw_new) &&
+ Current.Previous && Current.Previous->is(TT_CastRParen) &&
+ Current.Previous->MatchingParen &&
> benhamilton wrote:
> > djasper wrote:
> > > Isn't it wrong that we detect this as a cast r_paren in the first place?
> > Fantastic question, I asked myself the same thing.
> > I tried a few variations on this (leaving it as `TT_Unknown`, making a new
> > type, etc.) and discovered there is at least one existing place which
> > relies on the `TT_CastRParen` type as an indicator of ObjC code. Example:
> > https://github.com/llvm-mirror/clang/blob/e37a191e99773959118155304ec2ed0bc0d591c2/lib/Format/TokenAnnotator.cpp#L394
> > I can fix those, but if I do so, I think it should be a separate diff. What
> > do you think?
> @djasper and I talked about this on Friday and agreed we should follow up
> I filed https://bugs.llvm.org/show_bug.cgi?id=36976 to follow up.
You might also want to add a
// FIXME: ...
cfe-commits mailing list