diff options
author | Douglas Gregor <dgregor@apple.com> | 2009-05-29 14:25:00 +0000 |
---|---|---|
committer | Douglas Gregor <dgregor@apple.com> | 2009-05-29 14:25:00 +0000 |
commit | 8e92bf33baa91a8d97cbd4859648af149d5b5e74 (patch) | |
tree | 7547fa5e9a9a7852214a6014beed943eb3225a85 /lib | |
parent | c1dc653b08226c1d8e1732f9d8b03b82869900bc (diff) |
Now that we have declared/defined tag types within DeclGroups,
instantiation of tags local to member functions of class templates
(and, eventually, function templates) works when the tag is defined as
part of the decl-specifier-seq, e.g.,
struct S { T x, y; } s1;
Also, make sure that we don't try to default-initialize a dependent
type.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@72568 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib')
-rw-r--r-- | lib/Sema/SemaDecl.cpp | 2 | ||||
-rw-r--r-- | lib/Sema/SemaTemplateInstantiateDecl.cpp | 6 |
2 files changed, 1 insertions, 7 deletions
diff --git a/lib/Sema/SemaDecl.cpp b/lib/Sema/SemaDecl.cpp index 8bd753abea..abae9f04cc 100644 --- a/lib/Sema/SemaDecl.cpp +++ b/lib/Sema/SemaDecl.cpp @@ -2701,7 +2701,7 @@ void Sema::ActOnUninitializedDecl(DeclPtrTy dcl) { if (const ArrayType *Array = Context.getAsArrayType(Type)) InitType = Array->getElementType(); if ((!Var->hasExternalStorage() && !Var->isExternC(Context)) && - InitType->isRecordType()) { + InitType->isRecordType() && !InitType->isDependentType()) { CXXRecordDecl *RD = cast<CXXRecordDecl>(InitType->getAsRecordType()->getDecl()); CXXConstructorDecl *Constructor = 0; diff --git a/lib/Sema/SemaTemplateInstantiateDecl.cpp b/lib/Sema/SemaTemplateInstantiateDecl.cpp index 39e455a6ec..ef351f0954 100644 --- a/lib/Sema/SemaTemplateInstantiateDecl.cpp +++ b/lib/Sema/SemaTemplateInstantiateDecl.cpp @@ -97,8 +97,6 @@ Decl *TemplateDeclInstantiator::VisitTypedefDecl(TypedefDecl *D) { Typedef->setInvalidDecl(); Owner->addDecl(SemaRef.Context, Typedef); - if (Owner->isFunctionOrMethod()) - SemaRef.CurrentInstantiationScope->InstantiatedLocal(D, Typedef); return Typedef; } @@ -214,8 +212,6 @@ Decl *TemplateDeclInstantiator::VisitEnumDecl(EnumDecl *D) { Enum->setInstantiationOfMemberEnum(D); Enum->setAccess(D->getAccess()); Owner->addDecl(SemaRef.Context, Enum); - if (Owner->isFunctionOrMethod()) - SemaRef.CurrentInstantiationScope->InstantiatedLocal(D, Enum); Enum->startDefinition(); llvm::SmallVector<Sema::DeclPtrTy, 16> Enumerators; @@ -281,8 +277,6 @@ Decl *TemplateDeclInstantiator::VisitCXXRecordDecl(CXXRecordDecl *D) { Record->setInstantiationOfMemberClass(D); Owner->addDecl(SemaRef.Context, Record); - if (Owner->isFunctionOrMethod()) - SemaRef.CurrentInstantiationScope->InstantiatedLocal(D, Record); return Record; } |