[clang] [clang][ASTImporter] Add import of node 'TemplateParamObjectDecl' (PR #193492)
DonĂ¡t Nagy via cfe-commits
cfe-commits at lists.llvm.org
Tue May 5 02:52:14 PDT 2026
================
@@ -4099,6 +4099,41 @@ TEST_P(ASTImporterOptionSpecificTestBase,
unless(classTemplatePartialSpecializationDecl()))));
}
+TEST_P(ASTImporterOptionSpecificTestBase, ImportTemplateParamObjectDecl) {
+ const char *Code = R"(
+ struct A { int x, y; };
+ template<A> struct S1 {};
+ template<A, int> struct S2 {};
+ S1<A{1, 2}> s1;
+ S2<A{1, 2}, 3> s2;
+ )";
+ Decl *TU = getTuDecl(Code, Lang_CXX20, "input.cc");
+
+ auto *FromFirstSpec =
+ FirstDeclMatcher<ClassTemplateSpecializationDecl>().match(
+ TU, classTemplateSpecializationDecl());
+ auto *FromLastSpec =
+ FirstDeclMatcher<ClassTemplateSpecializationDecl>().match(
----------------
NagyDonat wrote:
Based on the name of the variable I think you wanted to write
```suggestion
auto *FromLastSpec =
LastDeclMatcher<ClassTemplateSpecializationDecl>().match(
```
Do I understand this correctly?
https://github.com/llvm/llvm-project/pull/193492
More information about the cfe-commits
mailing list