[PATCH] D30575: [clang-format] Look at NoLineBreak and NoLineBreakInOperand before breakProtrudingToken

Daniel Jasper via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Wed Mar 8 03:32:09 PST 2017


djasper added inline comments.


================
Comment at: lib/Format/ContinuationIndenter.cpp:852
+  bool CanBreakProtrudingToken =
+      State.Stack.empty() || (!State.Stack.back().NoLineBreak &&
+                              !State.Stack.back().NoLineBreakInOperand);
----------------
I think we assume here and in many other place that the stack is never empty. E.g. there is no similar check in l.847 above. So, I'd remove this here, too. In the long run, we probably want to have a class properly wrapping the Stack.


https://reviews.llvm.org/D30575





More information about the cfe-commits mailing list