diff options
author | John McCall <rjmccall@apple.com> | 2010-10-15 04:57:14 +0000 |
---|---|---|
committer | John McCall <rjmccall@apple.com> | 2010-10-15 04:57:14 +0000 |
commit | b6bbcc9995186799a60ce17d0c1acff31601653a (patch) | |
tree | b77c28179567896d71c528c70ae0d2837496c9e3 /lib/Sema | |
parent | 66c42d443982a0891ce58deb7391d641ca87adc5 (diff) |
Death to blocks, or at least the word "block" in one particular obnoxiously
ambiguous context.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@116567 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Sema')
-rw-r--r-- | lib/Sema/SemaDecl.cpp | 4 | ||||
-rw-r--r-- | lib/Sema/SemaDeclCXX.cpp | 2 | ||||
-rw-r--r-- | lib/Sema/SemaStmt.cpp | 4 |
3 files changed, 5 insertions, 5 deletions
diff --git a/lib/Sema/SemaDecl.cpp b/lib/Sema/SemaDecl.cpp index 4a834cd560..bced4a0b8c 100644 --- a/lib/Sema/SemaDecl.cpp +++ b/lib/Sema/SemaDecl.cpp @@ -4239,7 +4239,7 @@ void Sema::AddInitializerToDecl(Decl *RealDecl, Expr *Init, bool DirectInit) { // Get the decls type and save a reference for later, since // CheckInitializerTypes may change it. QualType DclT = VDecl->getType(), SavT = DclT; - if (VDecl->isBlockVarDecl()) { + if (VDecl->isLocalVarDecl()) { if (VDecl->hasExternalStorage()) { // C99 6.7.8p5 Diag(VDecl->getLocation(), diag::err_block_extern_cant_init); VDecl->setInvalidDecl(); @@ -4478,7 +4478,7 @@ void Sema::ActOnUninitializedDecl(Decl *RealDecl, // Block scope. C99 6.7p7: If an identifier for an object is // declared with no linkage (C99 6.2.2p6), the type for the // object shall be complete. - if (!Type->isDependentType() && Var->isBlockVarDecl() && + if (!Type->isDependentType() && Var->isLocalVarDecl() && !Var->getLinkage() && !Var->isInvalidDecl() && RequireCompleteType(Var->getLocation(), Type, diag::err_typecheck_decl_incomplete_type)) diff --git a/lib/Sema/SemaDeclCXX.cpp b/lib/Sema/SemaDeclCXX.cpp index ee0b172ee6..14d746acb7 100644 --- a/lib/Sema/SemaDeclCXX.cpp +++ b/lib/Sema/SemaDeclCXX.cpp @@ -90,7 +90,7 @@ namespace { // C++ [dcl.fct.default]p7 // Local variables shall not be used in default argument // expressions. - if (VDecl->isBlockVarDecl()) + if (VDecl->isLocalVarDecl()) return S->Diag(DRE->getSourceRange().getBegin(), diag::err_param_default_argument_references_local) << VDecl->getDeclName() << DefaultArg->getSourceRange(); diff --git a/lib/Sema/SemaStmt.cpp b/lib/Sema/SemaStmt.cpp index fd196af198..ddee9cca6d 100644 --- a/lib/Sema/SemaStmt.cpp +++ b/lib/Sema/SemaStmt.cpp @@ -914,7 +914,7 @@ Sema::ActOnForStmt(SourceLocation ForLoc, SourceLocation LParenLoc, for (DeclStmt::decl_iterator DI=DS->decl_begin(), DE=DS->decl_end(); DI!=DE; ++DI) { VarDecl *VD = dyn_cast<VarDecl>(*DI); - if (VD && VD->isBlockVarDecl() && !VD->hasLocalStorage()) + if (VD && VD->isLocalVarDecl() && !VD->hasLocalStorage()) VD = 0; if (VD == 0) Diag((*DI)->getLocation(), diag::err_non_variable_decl_in_for); @@ -962,7 +962,7 @@ Sema::ActOnObjCForCollectionStmt(SourceLocation ForLoc, // declare identifiers for objects having storage class 'auto' or // 'register'. VarDecl *VD = cast<VarDecl>(D); - if (VD->isBlockVarDecl() && !VD->hasLocalStorage()) + if (VD->isLocalVarDecl() && !VD->hasLocalStorage()) return StmtError(Diag(VD->getLocation(), diag::err_non_variable_decl_in_for)); } else { |