diff options
author | Douglas Gregor <dgregor@apple.com> | 2009-02-26 22:19:44 +0000 |
---|---|---|
committer | Douglas Gregor <dgregor@apple.com> | 2009-02-26 22:19:44 +0000 |
commit | d56a91e8f6a63b1c7c69b604f5defb0a94a5c388 (patch) | |
tree | 096c9ef8c7ea9f745810227a80ac1c1e4ec76541 /clang/lib/Sema/SemaTemplate.cpp | |
parent | e9817aaa0595eae687c06e3c9d9ecfe00a47aa0d (diff) | |
download | bcm5719-llvm-d56a91e8f6a63b1c7c69b604f5defb0a94a5c388.tar.gz bcm5719-llvm-d56a91e8f6a63b1c7c69b604f5defb0a94a5c388.zip |
Make the type associated with a ClassTemplateSpecializationDecl be a
nicely sugared type that shows how the user wrote the actual
specialization. This sugared type won't actually show up until we
start doing instantiations.
llvm-svn: 65577
Diffstat (limited to 'clang/lib/Sema/SemaTemplate.cpp')
-rw-r--r-- | clang/lib/Sema/SemaTemplate.cpp | 16 |
1 files changed, 14 insertions, 2 deletions
diff --git a/clang/lib/Sema/SemaTemplate.cpp b/clang/lib/Sema/SemaTemplate.cpp index f69f546177c..97eb9be36cc 100644 --- a/clang/lib/Sema/SemaTemplate.cpp +++ b/clang/lib/Sema/SemaTemplate.cpp @@ -1727,8 +1727,20 @@ Sema::ActOnClassTemplateSpecialization(Scope *S, unsigned TagSpec, TagKind TK, } } - // FIXME: We want to create a nicely sugared type to use as the - // type of this explicit specialization. + // Build the fully-sugared type for this class template + // specialization as the user wrote in the specialization + // itself. This means that we'll pretty-print the type retrieved + // from the specialization's declaration the way that the user + // actually wrote the specialization, rather than formatting the + // name based on the "canonical" representation used to store the + // template arguments in the specialization. + Specialization->setTypeAsWritten( + Context.getClassTemplateSpecializationType(ClassTemplate, + TemplateArgs.size(), + reinterpret_cast<uintptr_t *>(TemplateArgs.getArgs()), + TemplateArgs.getArgIsType(), + Context.getTypeDeclType(Specialization))); + TemplateArgs.release(); // C++ [temp.expl.spec]p9: // A template explicit specialization is in the scope of the |