aboutsummaryrefslogtreecommitdiff
path: root/clang/lib/Sema/SemaStmt.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'clang/lib/Sema/SemaStmt.cpp')
-rw-r--r--clang/lib/Sema/SemaStmt.cpp6
1 files changed, 5 insertions, 1 deletions
diff --git a/clang/lib/Sema/SemaStmt.cpp b/clang/lib/Sema/SemaStmt.cpp
index 3f89843..a5f9202 100644
--- a/clang/lib/Sema/SemaStmt.cpp
+++ b/clang/lib/Sema/SemaStmt.cpp
@@ -2284,7 +2284,11 @@ StmtResult Sema::ActOnForStmt(SourceLocation ForLoc, SourceLocation LParenLoc,
// we can diagnose if we don't see any variable declarations. This
// covers a case like declaring a typedef, function, or structure
// type rather than a variable.
- NonVarSeen = DI;
+ //
+ // Note, _Static_assert is acceptable because it does not declare an
+ // identifier at all, so "for object having" does not apply.
+ if (!isa<StaticAssertDecl>(DI))
+ NonVarSeen = DI;
}
}
// Diagnose if we saw a non-variable declaration but no variable