[PATCH] Correctly detect colon in bit fields. Fixes PR17333.
    Daniel Jasper 
    djasper at google.com
       
    Thu Oct 10 06:09:21 PDT 2013
    
    
  
================
Comment at: lib/Format/TokenAnnotator.cpp:335
@@ -335,1 +334,3 @@
           Contexts.back().FirstObjCSelectorName = Tok->Previous;
+      } else if (Tok->Next && Tok->Next->is(tok::numeric_constant)) {
+        Tok->Type = TT_BitFieldColon;
----------------
Tok->Next == CurrentToken, so I think we should use that consistently.
Probably not important, but maybe move this down at least past the range-based for loop.. This would be valid code AFAICT:
  vector<vector<int>> V;
  for (int i : 4[V]) {
  }
http://llvm-reviews.chandlerc.com/D1884
BRANCH
  svn
ARCANIST PROJECT
  clang
    
    
More information about the cfe-commits
mailing list