summaryrefslogtreecommitdiffstats
path: root/clang/lib
diff options
context:
space:
mode:
Diffstat (limited to 'clang/lib')
-rw-r--r--clang/lib/Sema/SemaDecl.cpp3
1 files changed, 3 insertions, 0 deletions
diff --git a/clang/lib/Sema/SemaDecl.cpp b/clang/lib/Sema/SemaDecl.cpp
index 8a4ffaf65de..e99be90963e 100644
--- a/clang/lib/Sema/SemaDecl.cpp
+++ b/clang/lib/Sema/SemaDecl.cpp
@@ -2503,6 +2503,9 @@ static bool StatementCreatesScope(Stmt* S) {
i != DS->decl_end(); ++i) {
if (VarDecl* D = dyn_cast<VarDecl>(*i)) {
result |= D->getType()->isVariablyModifiedType();
+ result |= !!D->getAttr<CleanupAttr>();
+ } else if (TypedefDecl* D = dyn_cast<TypedefDecl>(*i)) {
+ result |= D->getUnderlyingType()->isVariablyModifiedType();
}
}
}
OpenPOWER on IntegriCloud