max-winkler

Results comments of max-winkler

I've opened #239378 which omits empty optional string arguments for all affected attributes, including `deprecated`. Feedback welcome.

> I'm not sure if this is by design, not implemented yet or just a bug? It's not implemented. The printing is done [here](https://github.com/llvm/llvm-project/blob/cea5c19e197e8477acf510b1426c76616f6f7a0d/clang/lib/AST/TypePrinter.cpp#L1966-L1973): ```c++ if (T->getAttrKind() == attr::AnnotateType) {...

@HighCommander4 Thanks for the pointers. I traced this with a Debug build and can confirm the exact mechanism you described. The relevant spot is `getParamType` in SemaCodeComplete.cpp [here](https://github.com/llvm/llvm-project/blob/dcef585fd51c423acb1175bdeea8c5a3ed05b7cd/clang/lib/Sema/SemaCodeComplete.cpp#L6450) ```c++ if...

I was able to reproduce this and traced it down to `PPExpressions.cpp:604` [(here)](https://github.com/llvm/llvm-project/blob/ae614a9564425ab206940f2b91607b1d77826068/clang/lib/Lex/PPExpressions.cpp#L604) PP.DiscardUntilEndOfDirective(PeekTok); When checking the example source file, `PeekTok` is of kind `tok::eod` and this seems to be...

@iliasabk, is it OK for you if I open a PR? I investigated this bug a bit further and prepared a fix plus unit tests.

I would like to work on this. I debugged the `print` function in detail and I think I know how to fix it.

I looked into this and found the cause. ## Cause In `T...[0] x;` the parser creates a `PackIndexingType` and then calls `Parser::AnnotateExistingIndexedTypeNamePack` [(here)](https://github.com/llvm/llvm-project/blob/368f3f8960a4a896e6fb1dc1f11c58ac1fc12267/clang/lib/Parse/ParseExprCXX.cpp#L230) , which collapses the tokens `T ......

Update: I investigated which parts of my fix are actually needed. Only the changes in `SemaType.cpp` (initialize the pattern `TypeLoc`) and in `RecursiveASTVisitor.h` (traverse the pattern `TypeLoc`) are required for...

This is fixed on main by two changes: - llvm/llvm-project#232194 builds the pattern TypeLoc and the ellipsis location of PackIndexingTypeLoc correctly. - llvm/llvm-project#231191 makes RecursiveASTVisitor traverse the pattern as a...