summaryrefslogtreecommitdiffstats
path: root/clang/lib/Sema/SemaDecl.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'clang/lib/Sema/SemaDecl.cpp')
-rw-r--r--clang/lib/Sema/SemaDecl.cpp8
1 files changed, 2 insertions, 6 deletions
diff --git a/clang/lib/Sema/SemaDecl.cpp b/clang/lib/Sema/SemaDecl.cpp
index d6d13384b2c..a6ba359972f 100644
--- a/clang/lib/Sema/SemaDecl.cpp
+++ b/clang/lib/Sema/SemaDecl.cpp
@@ -2380,7 +2380,7 @@ Sema::ActOnTypedefDeclarator(Scope* S, Declarator& D, DeclContext* DC,
// then it shall have block scope.
QualType T = NewTD->getUnderlyingType();
if (T->isVariablyModifiedType()) {
- FunctionNeedsScopeChecking() = true;
+ setFunctionHasBranchProtectedScope();
if (S->getFnParent() == 0) {
bool SizeIsNegative;
@@ -2794,12 +2794,8 @@ void Sema::CheckVariableDeclaration(VarDecl *NewVD,
bool isVM = T->isVariablyModifiedType();
if (isVM || NewVD->hasAttr<CleanupAttr>() ||
NewVD->hasAttr<BlocksAttr>() ||
- // FIXME: We need to diagnose jumps passed initialized variables in C++.
- // However, this turns on the scope checker for everything with a variable
- // which may impact compile time. See if we can find a better solution
- // to this, perhaps only checking functions that contain gotos in C++?
(LangOpts.CPlusPlus && NewVD->hasLocalStorage()))
- FunctionNeedsScopeChecking() = true;
+ setFunctionHasBranchProtectedScope();
if ((isVM && NewVD->hasLinkage()) ||
(T->isVariableArrayType() && NewVD->hasGlobalStorage())) {
OpenPOWER on IntegriCloud