We were doing this already for type aliases, and it deduplicates the
code looking through aliases and pointers to find a function type. As
a side effect, this finds two warnings that we apparently missed before.
Details
Diff Detail
- Repository
- rG LLVM Github Monorepo
Event Timeline
I feel uneasy about claiming that variable decls of function type are FunctionKind for the purposes of comment parsing (even doing it for typedefs is questionable). It seems like a better way would be to make "is function like" an extra dimension that can be combined with any decl kind.
However since no tests break, it might be not an issue in practice.
Agreed, I'll try to write a patch for that. Essentially we want to know if some kind of function type (or maybe just FunctionProtoType?) is involved in that declaration (without desugaring), either of a type declaration, or of the declared type of a non-type declaration. That's pretty much orthogonal to the kind. (Though it's of course incompatible with some kinds, such as EnumKind or NamespaceKind.)
I'm wondering about global lambdas declarations. These should have class type, but also have parameters like a function.