To prevent potential bugs in situations where we want to peek the next non-comment token.
Details
Diff Detail
- Repository
- rG LLVM Github Monorepo
Event Timeline
clang/lib/Format/UnwrappedLineParser.cpp | ||
---|---|---|
3592–3601 | We should pass true to peekNextToken() on Line 3597 here, but removing this entire case would have no effect on the existing unit test (Line 23693 in FormatTest.cpp). @HazardyKnusperkeks any idea? |
clang/lib/Format/UnwrappedLineParser.cpp | ||
---|---|---|
3592–3601 | The peeking is there because of https://reviews.llvm.org/D134325, it has no format tests, only an annotator test |
clang/lib/Format/UnwrappedLineParser.cpp | ||
---|---|---|
3592–3601 | Also, I don't think that function is involved in concept declarations since https://reviews.llvm.org/D140339 |
clang/lib/Format/UnwrappedLineParser.cpp | ||
---|---|---|
3592–3601 | So which tests were meant to check the kw_bool case here? |
clang/lib/Format/UnwrappedLineParser.cpp | ||
---|---|---|
3592–3601 | Well, originally the one you mentioned on line 23693, but since the code paths have been changed, I think it's really only the one added in https://reviews.llvm.org/D134325 |
clang/lib/Format/UnwrappedLineParser.cpp | ||
---|---|---|
3592–3601 | I love the new annotator tests, but we should probably always try to add a verifyFormat test as well even if its trivial in the future, just so we have some context as to what type of code warranted the change. |
clang/lib/Format/UnwrappedLineParser.cpp | ||
---|---|---|
3592–3601 | @rymiel @HazardyKnusperkeks thanks for the explanations. Can we remove the kw_bool case then? |
clang/lib/Format/UnwrappedLineParser.cpp | ||
---|---|---|
3592–3601 |
You are right! I forgot the fact that this only ever applied for concepts, and the bug fix only ever worked around that. I had it backwards in my head because the bug affected requires clauses too. |
We should pass true to peekNextToken() on Line 3597 here, but removing this entire case would have no effect on the existing unit test (Line 23693 in FormatTest.cpp). @HazardyKnusperkeks any idea?