sammccall added inline comments.

================
Comment at: clang/lib/Format/TokenAnnotator.cpp:1347
       Contexts.back().CanBeExpression = false;
-    } else if (Current.isOneOf(tok::semi, tok::exclaim)) {
+    } else if (Current.isOneOf(tok::semi, tok::exclaim) &&
+               !(Current.Previous && Current.Previous->is(tok::kw_operator))) {
----------------
This seems clearer as `is semi || (is exclaim && !previous is operator)`, as 
`operator;` isn't relevant here.
`&& !Current.is(TT_OverloadedOperator) would be even better of course`


================
Comment at: clang/lib/Format/TokenAnnotator.cpp:2090
         continue;
+      if (Next->isOneOf(tok::star, tok::arrow))
+        continue;
----------------
This seems like it's supposed to be handled by the token annotator, and the 
same cause will result in bugs in other places - why aren't these tokens being 
marked as TT_OverloadedOperator?

I'd guess the deeper fix is in the `kw_operator` case in consumeToken(). The 
way it's written looks suspect, though I'm not an expert on any of this.


Repository:
  rC Clang

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D69573/new/

https://reviews.llvm.org/D69573



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

Reply via email to