aboutsummaryrefslogtreecommitdiff
path: root/lib/Sema/SemaTemplateInstantiateDecl.cpp
diff options
context:
space:
mode:
authorAnders Carlsson <andersca@mac.com>2009-09-01 06:22:14 +0000
committerAnders Carlsson <andersca@mac.com>2009-09-01 06:22:14 +0000
commitcdc83c777973fa56b6f828bfe88210290ca58d62 (patch)
tree1c99b418de094a79ceb19ba8a9e5825c60b31eea /lib/Sema/SemaTemplateInstantiateDecl.cpp
parentc17fb7bd9a06b027c792c7dfad7e9fa430277aff (diff)
Don't assume that a base is always a RecordType, it can also be a TemplateSpecializationType. Also, make sure to get the instantiated union member.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@80662 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Sema/SemaTemplateInstantiateDecl.cpp')
-rw-r--r--lib/Sema/SemaTemplateInstantiateDecl.cpp3
1 files changed, 1 insertions, 2 deletions
diff --git a/lib/Sema/SemaTemplateInstantiateDecl.cpp b/lib/Sema/SemaTemplateInstantiateDecl.cpp
index 82228143e4..99b237d04e 100644
--- a/lib/Sema/SemaTemplateInstantiateDecl.cpp
+++ b/lib/Sema/SemaTemplateInstantiateDecl.cpp
@@ -1145,7 +1145,6 @@ Sema::InstantiateMemInitializers(CXXConstructorDecl *New,
QualType BaseType(Init->getBaseClass(), 0);
BaseType = SubstType(BaseType, TemplateArgs, Init->getSourceLocation(),
New->getDeclName());
- BaseType = Context.getCanonicalType(BaseType);
NewInit = BuildBaseInitializer(BaseType,
(Expr **)NewArgs.data(),
@@ -1158,7 +1157,7 @@ Sema::InstantiateMemInitializers(CXXConstructorDecl *New,
// Is this an anonymous union?
if (FieldDecl *UnionInit = Init->getAnonUnionMember())
- Member = cast<FieldDecl>(UnionInit);
+ Member = cast<FieldDecl>(FindInstantiatedDecl(UnionInit));
else
Member = cast<FieldDecl>(FindInstantiatedDecl(Init->getMember()));