Details
Diff Detail
- Repository
- rG LLVM Github Monorepo
Event Timeline
| clang/unittests/Format/FormatTest.cpp | ||
|---|---|---|
| 23814 | How about other kinds? Is there a way to be more generic and treat all identifier-like entities like identifiers? | |
| 23814 | I'd like to see a test for ALIASes as well, e.g. __is_same_as. | |
| clang/unittests/Format/FormatTest.cpp | ||
|---|---|---|
| 23814 |
I was conservative, since I don't know what these kind of traits are. But sure can add.
Not that I know of. There is no such function in TokenKind.h. | |
| clang/unittests/Format/FormatTest.cpp | ||
|---|---|---|
| 23814 | I have no idea how to handle the aliases, since there are many, and most are no traits, not correct here. We could add __is_same_as, as it seems to be the only trait alias, directly. | |
Thanks for handling other traits! LGTM % alias test.
| clang/unittests/Format/FormatTest.cpp | ||
|---|---|---|
| 23814 | I don't think you need to treat them specially, they should behave as their aliased entity actually. But please test at least one. | |
| clang/lib/Format/UnwrappedLineParser.cpp | ||
|---|---|---|
| 3137–3140 | Instead, you can fold case tok::identifier: below into default: like this: default:
if (!FormatTok->Tok.getIdentifierInfo())
return;
// We need to differentiate identifiers for a template deduction guide,
... | |
| clang/lib/Format/UnwrappedLineParser.cpp | ||
|---|---|---|
| 3137–3140 | Thanks. | |
Thanks for working on this!
| clang/lib/Format/UnwrappedLineParser.cpp | ||
|---|---|---|
| 3210 | I'd prefer to get rid of default if we can. | |
| clang/lib/Format/UnwrappedLineParser.cpp | ||
|---|---|---|
| 3210 | We can't. It's the whole point of the fix. | |
Instead, you can fold case tok::identifier: below into default: like this:
default: if (!FormatTok->Tok.getIdentifierInfo()) return; // We need to differentiate identifiers for a template deduction guide, ...