Skip to content

[clang] Empty USR for any decl whose signature mentions a class-type NTTP #212351

Description

@patrykstefanski

USRGenerator has no visitor for TemplateParamObjectDecl, which is the AST node representing a class-type non-type template parameter. It falls through to VisitNamedDecl, which fails on the node's empty DeclarationName and sets IgnoreResults, discarding the USR of the enclosing declaration.

Any function or method whose signature mentions such a type gets no USR at all, and is silently dropped by USR consumers.

struct R { int a; };
template<R> struct L { };
void f(L<R{0}>);
$ c-index-test core -print-source-symbols -- -std=c++20 -x c++ t.cpp
3:6 | function/C | f | <no-usr> | __Z1f1LIXtl1REEE | Decl | rel: 0

We can see <no-usr>, which implies that USR generation fails.

Metadata

Metadata

Labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions