VarTemplateSpecializationDecl does not store a template param list,
so the "template<>" needs to be stored in the ExtInfo.
Details
Diff Detail
- Repository
- rG LLVM Github Monorepo
Event Timeline
So far the only test I added is in clangd semantic highlighting because that's how I noticed the template<> missing from the AST, but I'm open to suggestions on where to add a test at the clang layer.
We have a good amount of AST-dump tests around that are likely the right place to put them perhaps? What is the reproducer that caused you to discover this issue?
The following is sufficient to reproduce:
template <typename T> T x = {}; template <> int x<int> = 42;
However, the patch does not alter the ast-dump (it looks like the template param lists stored in DeclaratorDecl's getExtInfo()->TemplParamLists are not printed).
sorry for the delay, just started unburying myself from the 16.0 release process. Its unfortunate we don't have a great way to test this, but I can see the value of having it anyway in clangd.