[PATCH] D47058: [ASTImporter] Fix ClassTemplateSpecialization in wrong DC
Gabor Marton via Phabricator via cfe-commits
cfe-commits at lists.llvm.org
Thu May 24 04:10:06 PDT 2018
martong added a comment.
> Could you add a test for TSK_Undeclared as well?
TLDR: No, I cannot.
`TSK_Undeclared` is used to indicate that a template specialization was formed from a template-id but has not yet been declared, defined, or instantiated.
Consequently, `ClassTemplateSpecializationDecl::ClassTemplateSpecializationDecl` and `VarTemplateSpecializationDecl::VarTemplateSpecializationDecl` initializes its member `SpecializationKind` to the value `TSK_Undeclared`.
`SpecializationKind` is getting set during parsing to a meaningful kind, it is never left as `TSK_Undeclared`.
So, the only way I could write a test is to manually change the `SpecializationKind` in the "From" context, but I consider that as not a meaningful test, since we cannot create such `Decl` by the parser.
More information about the cfe-commits