summaryrefslogtreecommitdiffstats
path: root/clang/lib
diff options
context:
space:
mode:
authorDouglas Gregor <dgregor@apple.com>2009-05-29 14:25:00 +0000
committerDouglas Gregor <dgregor@apple.com>2009-05-29 14:25:00 +0000
commit8157b07caf5fcf953096dfd8bfa5a97152c764c5 (patch)
treef0b801960f4ac5185d53ff4885ce05f37e180a3e /clang/lib
parent6a94624a1b8608a57d2f8e50df71949f2984c44f (diff)
downloadbcm5719-llvm-8157b07caf5fcf953096dfd8bfa5a97152c764c5.tar.gz
bcm5719-llvm-8157b07caf5fcf953096dfd8bfa5a97152c764c5.zip
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. llvm-svn: 72568
Diffstat (limited to 'clang/lib')
-rw-r--r--clang/lib/Sema/SemaDecl.cpp2
-rw-r--r--clang/lib/Sema/SemaTemplateInstantiateDecl.cpp6
2 files changed, 1 insertions, 7 deletions
diff --git a/clang/lib/Sema/SemaDecl.cpp b/clang/lib/Sema/SemaDecl.cpp
index 8bd753abeae..abae9f04cc1 100644
--- a/clang/lib/Sema/SemaDecl.cpp
+++ b/clang/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/clang/lib/Sema/SemaTemplateInstantiateDecl.cpp b/clang/lib/Sema/SemaTemplateInstantiateDecl.cpp
index 39e455a6ec7..ef351f09543 100644
--- a/clang/lib/Sema/SemaTemplateInstantiateDecl.cpp
+++ b/clang/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;
}
OpenPOWER on IntegriCloud