aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJohn McCall <rjmccall@apple.com>2009-10-21 03:40:01 +0000
committerJohn McCall <rjmccall@apple.com>2009-10-21 03:40:01 +0000
commit3c50bfe3d9d4bda4183a541d97ec5b32bbae7aab (patch)
treea565e4f64f2b5bb2f96d0542b92bb34eabe09c1f
parent1dc9acdb06dbd5f0a5747dd0ffa7ede680d7ca08 (diff)
Revert those last two commits. Beware the treacherous semicolon.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@84736 91177308-0d34-0410-b5e6-96231b3b80d8
-rw-r--r--lib/Sema/SemaTemplateInstantiateDecl.cpp28
1 files changed, 14 insertions, 14 deletions
diff --git a/lib/Sema/SemaTemplateInstantiateDecl.cpp b/lib/Sema/SemaTemplateInstantiateDecl.cpp
index 0bd4ee520c..0a75383842 100644
--- a/lib/Sema/SemaTemplateInstantiateDecl.cpp
+++ b/lib/Sema/SemaTemplateInstantiateDecl.cpp
@@ -204,11 +204,11 @@ Decl *TemplateDeclInstantiator::VisitVarDecl(VarDecl *D) {
Decl *TemplateDeclInstantiator::VisitFieldDecl(FieldDecl *D) {
bool Invalid = false;
- DeclaratorInfo *DI = D->getDeclaratorInfo();
- if (DI->getType()->isDependentType()) {
- DI = SemaRef.SubstType(DI, TemplateArgs,
- D->getLocation(), D->getDeclName());
- if (DI && DI->getType()->isFunctionType()) {
+ QualType T = D->getType();
+ if (T->isDependentType()) {
+ T = SemaRef.SubstType(T, TemplateArgs,
+ D->getLocation(), D->getDeclName());
+ if (!T.isNull() && T->isFunctionType()) {
// C++ [temp.arg.type]p3:
// If a declaration acquires a function type through a type
// dependent on a template-parameter and this causes a
@@ -238,8 +238,8 @@ Decl *TemplateDeclInstantiator::VisitFieldDecl(FieldDecl *D) {
BitWidth = InstantiatedBitWidth.takeAs<Expr>();
}
- FieldDecl *Field = SemaRef.CheckFieldDecl(D->getDeclName(),
- DI->getType(), DI,
+ FieldDecl *Field = SemaRef.CheckFieldDecl(D->getDeclName(), T,
+ D->getDeclaratorInfo(),
cast<RecordDecl>(Owner),
D->getLocation(),
D->isMutable(),
@@ -774,23 +774,23 @@ Decl *TemplateDeclInstantiator::VisitCXXConversionDecl(CXXConversionDecl *D) {
}
ParmVarDecl *TemplateDeclInstantiator::VisitParmVarDecl(ParmVarDecl *D) {
- DeclaratorInfo *OrigT = SemaRef.SubstType(D->DeclaratorInfo(), TemplateArgs,
- D->getLocation(), D->getDeclName());
- if (!OrigT)
+ QualType OrigT = SemaRef.SubstType(D->getOriginalType(), TemplateArgs,
+ D->getLocation(), D->getDeclName());
+ if (OrigT.isNull())
return 0;
- QualType T = SemaRef.adjustParameterType(OrigT->getType());
+ QualType T = SemaRef.adjustParameterType(OrigT);
// Allocate the parameter
ParmVarDecl *Param = 0;
- if (T == OrigT->getType())
+ if (T == OrigT)
Param = ParmVarDecl::Create(SemaRef.Context, Owner, D->getLocation(),
- D->getIdentifier(), T, OrigT,
+ D->getIdentifier(), T, D->getDeclaratorInfo(),
D->getStorageClass(), 0);
else
Param = OriginalParmVarDecl::Create(SemaRef.Context, Owner,
D->getLocation(), D->getIdentifier(),
- T, OrigT, OrigT->getType(),
+ T, D->getDeclaratorInfo(), OrigT,
D->getStorageClass(), 0);
// Mark the default argument as being uninstantiated.