owenpan added inline comments.
================ Comment at: clang/lib/Format/UnwrappedLineParser.cpp:2340-2341 if (!L.InPPDirective) { Tok = getLastNonComment(L); - if (Tok) + if (Tok) { + Tok = L.Tokens.back().Tok; ---------------- owenpan wrote: > HazardyKnusperkeks wrote: > > So basically one would just need a `Line.isComment()` or so? The > > `lastNonComment` is not important, right? > We don't really need a pointer to the last non-comment token here as we would > return the last token of the line, but the pointer is still needed for the > left brace above. We have to try to find either the first or the last non-comment token in `L` to determine if it's a comment line, for `L` can be something like: ``` /* comment */ f(); // comment ``` CHANGES SINCE LAST ACTION https://reviews.llvm.org/D120503/new/ https://reviews.llvm.org/D120503 _______________________________________________ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits