diff options
author | Anders Carlsson <andersca@mac.com> | 2009-12-03 17:49:57 +0000 |
---|---|---|
committer | Anders Carlsson <andersca@mac.com> | 2009-12-03 17:49:57 +0000 |
commit | 51f940457ab20f82c62c2093389763bb9f5187eb (patch) | |
tree | 25275640641e0cfedc05927199d9377856bcbc32 /lib/Sema/SemaTemplateInstantiate.cpp | |
parent | a7a8dfd702274fd19ef8b237682b75d814ecfc91 (diff) |
When instantiating a class, if a base specifier is not dependent we still need to copy its attributes down to the instantiated class.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@90463 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Sema/SemaTemplateInstantiate.cpp')
-rw-r--r-- | lib/Sema/SemaTemplateInstantiate.cpp | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/lib/Sema/SemaTemplateInstantiate.cpp b/lib/Sema/SemaTemplateInstantiate.cpp index 623cde87a9..250d14c865 100644 --- a/lib/Sema/SemaTemplateInstantiate.cpp +++ b/lib/Sema/SemaTemplateInstantiate.cpp @@ -936,6 +936,13 @@ Sema::SubstBaseSpecifiers(CXXRecordDecl *Instantiation, Base = Pattern->bases_begin(), BaseEnd = Pattern->bases_end(); Base != BaseEnd; ++Base) { if (!Base->getType()->isDependentType()) { + const CXXRecordDecl *BaseDecl = + cast<CXXRecordDecl>(Base->getType()->getAs<RecordType>()->getDecl()); + + // Make sure to set the attributes from the base. + SetClassDeclAttributesFromBase(Instantiation, BaseDecl, + Base->isVirtual()); + InstantiatedBases.push_back(new (Context) CXXBaseSpecifier(*Base)); continue; } |