benhamilton 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 &&
----------------
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?


Repository:
  rC Clang

https://reviews.llvm.org/D44996



_______________________________________________
cfe-commits mailing list
cfe-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to