statements don't end up in the LabelMap so we don't have a quick way
to filter them. We could add state to Sema (a "has vla" and "has
jump" bit) to try to filter this out, but that would be sort of gross
and I'm not convinced it is the best way. Thoughts welcome.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@69476
91177308-0d34-0410-b5e6-
96231b3b80d8
assert(&getLabelMap() == &FunctionLabelMap && "Didn't pop block right?");
- bool HaveLabels = !FunctionLabelMap.empty();
// Check goto/label use.
for (llvm::DenseMap<IdentifierInfo*, LabelStmt*>::iterator
I = FunctionLabelMap.begin(), E = FunctionLabelMap.end(); I != E; ++I) {
if (!Body) return D;
- // If we have labels, verify that goto doesn't jump into scopes illegally.
- if (HaveLabels)
- JumpScopeChecker(Body, *this);
+ // Verify that that gotos and switch cases don't jump into scopes illegally.
+ JumpScopeChecker(Body, *this);
return D;
}
}
void test7(int x) {
-foo: // FIXME: remove
switch (x) {
case 1: ;
int a[x]; // expected-note {{jump bypasses initialization of variable length array}}