[clang] [Clang] Unify interface for accessing template arguments as written for class/variable template specializations (PR #81642)
Krystian Stasiowski via cfe-commits
cfe-commits at lists.llvm.org
Mon Feb 19 10:11:19 PST 2024
================
@@ -1792,23 +1807,11 @@ class ClassTemplateSpecializationDecl
llvm::PointerUnion<ClassTemplateDecl *, SpecializedPartialSpecialization *>
SpecializedTemplate;
- /// Further info for explicit template specialization/instantiation.
- struct ExplicitSpecializationInfo {
- /// The type-as-written.
- TypeSourceInfo *TypeAsWritten = nullptr;
-
- /// The location of the extern keyword.
- SourceLocation ExternLoc;
-
- /// The location of the template keyword.
- SourceLocation TemplateKeywordLoc;
-
- ExplicitSpecializationInfo() = default;
- };
-
/// Further info for explicit template specialization/instantiation.
/// Does not apply to implicit specializations.
- ExplicitSpecializationInfo *ExplicitInfo = nullptr;
+ llvm::PointerUnion<const ASTTemplateArgumentListInfo *,
+ ExplicitInstantiationInfo *>
+ ExplicitInfo = nullptr;
----------------
sdkrystian wrote:
> I spent some time to understand `const ASTTemplateArgumentListInfo *` is only meaningful for partial specializations.
Not quite... `const ASTTemplateArgumentListInfo *` is also used for explicit specializations. `ExplicitInstantiationInfo *` (should) only be used for explicit instantiations, I just need to remove any instances of `TemplateKeywordLoc` being set for non-explicit-instantiations specializations (planning to do this prior to merging).
https://github.com/llvm/llvm-project/pull/81642
More information about the cfe-commits
mailing list