Clean up the detection of parameter declarations in K&R C function definitions. Also make it more precise by requiring the second token after the r_paren to be either a star or keyword/identifier.
Details
Diff Detail
- Repository
- rG LLVM Github Monorepo
Event Timeline
clang/lib/Format/UnwrappedLineParser.cpp | ||
---|---|---|
1025 | Probably not unless we are to include a test case for every keyword. I can add them if you insist. | |
1029 | I think the existing test cases already cover this, which is a subset of the previous cases (the second token can be anything but tok::l_paren and tok::semi)? | |
1397 | No because FormatTok is not tok::eof. If AllTokens[Position] is null, it would be an internal error, which is asserted at the top of isC78ParameterDecl(). |
@owenpan Can we push all these commits to 13 RC2 via https://bugs.llvm.org/show_bug.cgi?id=51470
We need to mark the commits we want to cherry pick I think.
should we have test cases showing these examples?