curdeius added inline comments.
================
Comment at: clang/lib/Format/FormatTokenLexer.cpp:432
+ auto Forth = (Tokens.end() - 4)[0];
bool FourthTokenIsLess = false;
----------------
MyDeveloperDay wrote:
> isn't this going to crash if Tokens.size() is 3?
It probably will. Anyway, it's a UB. Please do it differently. Also, please fix
the typo: "Fourth".
================
Comment at: clang/unittests/Format/FormatTest.cpp:9278
verifyFormat("operator SomeType<SomeType<int>>();");
+ verifyFormat("operator< <>();");
+
----------------
Please add a test for a possible crash: something like `verifyFormat("< <>");`
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D117398/new/
https://reviews.llvm.org/D117398
_______________________________________________
cfe-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits