aboutsummaryrefslogtreecommitdiff
path: root/lib/Sema/SemaTemplate.cpp
diff options
context:
space:
mode:
authorDouglas Gregor <dgregor@apple.com>2009-02-26 22:19:44 +0000
committerDouglas Gregor <dgregor@apple.com>2009-02-26 22:19:44 +0000
commitfc705b84347e6fb4746a1a7e26949f64c2f2f358 (patch)
treee6ec475fb6c12bfe460fe56da06fc3b9cfd82e48 /lib/Sema/SemaTemplate.cpp
parent8af2975d50270813ae6366d007e9e1f5b65ddc68 (diff)
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. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@65577 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Sema/SemaTemplate.cpp')
-rw-r--r--lib/Sema/SemaTemplate.cpp16
1 files changed, 14 insertions, 2 deletions
diff --git a/lib/Sema/SemaTemplate.cpp b/lib/Sema/SemaTemplate.cpp
index f69f546177..97eb9be36c 100644
--- a/lib/Sema/SemaTemplate.cpp
+++ b/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