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/AST/Decl.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/AST/Decl.cpp')
-rw-r--r-- | clang/lib/AST/Decl.cpp | 14 |
1 files changed, 8 insertions, 6 deletions
diff --git a/clang/lib/AST/Decl.cpp b/clang/lib/AST/Decl.cpp index 2732bf93c18..ab654920238 100644 --- a/clang/lib/AST/Decl.cpp +++ b/clang/lib/AST/Decl.cpp @@ -374,22 +374,24 @@ OverloadedOperatorKind FunctionDecl::getOverloadedOperator() const { //===----------------------------------------------------------------------===// void TagDecl::startDefinition() { - cast<TagType>(TypeForDecl)->decl.setPointer(this); - cast<TagType>(TypeForDecl)->decl.setInt(1); + TagType *TagT = const_cast<TagType *>(TypeForDecl->getAsTagType()); + TagT->decl.setPointer(this); + TagT->getAsTagType()->decl.setInt(1); } void TagDecl::completeDefinition() { assert((!TypeForDecl || - cast<TagType>(TypeForDecl)->decl.getPointer() == this) && + TypeForDecl->getAsTagType()->decl.getPointer() == this) && "Attempt to redefine a tag definition?"); IsDefinition = true; - cast<TagType>(TypeForDecl)->decl.setPointer(this); - cast<TagType>(TypeForDecl)->decl.setInt(0); + TagType *TagT = const_cast<TagType *>(TypeForDecl->getAsTagType()); + TagT->decl.setPointer(this); + TagT->decl.setInt(0); } TagDecl* TagDecl::getDefinition(ASTContext& C) const { QualType T = C.getTypeDeclType(const_cast<TagDecl*>(this)); - TagDecl* D = cast<TagDecl>(cast<TagType>(T)->getDecl()); + TagDecl* D = cast<TagDecl>(T->getAsTagType()->getDecl()); return D->isDefinition() ? D : 0; } |