These aren't terribly common, but we currently mishandle them badly.
Not only do we not recogize the attributes themselves, but we often end up
selecting some node other than the parent (because source ranges aren't accurate
in the presence of attributes).
Details
Diff Detail
- Repository
- rG LLVM Github Monorepo
Event Timeline
clang-tools-extra/clangd/AST.cpp | ||
---|---|---|
434 | this looks like not safe, getNextTypeLoc() may return a null TypeLoc. | |
clang-tools-extra/clangd/unittests/ASTTests.cpp | ||
233 | sorry, I'm not familiar with attributes, what is an implicit attr? It is unclear to me why there is an attr for class X, the source code doesn't have any attribute label for X (the same question for f and a) |
clang-tools-extra/clangd/AST.cpp | ||
---|---|---|
434 | I don't think it can - an AttributedType always modifies a real type. | |
clang-tools-extra/clangd/unittests/ASTTests.cpp | ||
233 | Right, implicit attributes are when there's nothing written in the source ,but something else modifies the semantics in a way that clang authors decided to model as an attribute (e.g. because semantics match that of an explicit attribute). I'm not familiar with many examples either, but a couple:
The windows example was why I assert there are no explicit attributes, instead of that there are none at all. I've added a comment. |
clang-tools-extra/clangd/unittests/ASTTests.cpp | ||
---|---|---|
233 | ah, thanks for the explanation. |
this looks like not safe, getNextTypeLoc() may return a null TypeLoc.