D.getStorageClass() == VarDecl::Register ? ".reg." : ".auto.";
DeclPtr = GenerateStaticBlockVarDecl(D, true, Class);
}
- } else if (1) {
- // FIXME: The code below is disabled because is causes a regression in the
- // testsuite.
- CGM.ErrorUnsupported(&D, "variable-length array");
-
- const llvm::Type *LTy = ConvertType(Ty);
- llvm::AllocaInst *Alloc =
- CreateTempAlloca(LTy, D.getIdentifier()->getName());
- DeclPtr = Alloc;
} else {
const VariableArrayType *VAT = getContext().getAsVariableArrayType(Ty);
return;
}
+ if (StackSaveValues.back()) {
+ CGM.ErrorUnsupported(&S, "goto inside scope with VLA");
+ return;
+ }
+
// If this code is reachable then emit a stop point (if generating
// debug info). We have to do this ourselves because we are on the
// "simple" statement path.
/// if the function returns void, or may be missing one if the function returns
/// non-void. Fun stuff :).
void CodeGenFunction::EmitReturnStmt(const ReturnStmt &S) {
+ if (StackSaveValues.back()) {
+ CGM.ErrorUnsupported(&S, "return inside scope with VLA");
+ return;
+ }
+
// Emit the result value, even if unused, to evalute the side effects.
const Expr *RV = S.getRetValue();
// FIXME: Implement break in @try or @catch blocks.
if (ObjCEHStack.size() != BreakContinueStack.back().EHStackSize) {
- CGM.ErrorUnsupported(&S, "continue inside an Obj-C exception block");
+ CGM.ErrorUnsupported(&S, "break inside an Obj-C exception block");
return;
}
+ if (StackSaveValues.back()) {
+ CGM.ErrorUnsupported(&S, "break inside scope with VLA");
+ return;
+ }
+
// If this code is reachable then emit a stop point (if generating
// debug info). We have to do this ourselves because we are on the
// "simple" statement path.
return;
}
+ if (StackSaveValues.back()) {
+ CGM.ErrorUnsupported(&S, "continue inside scope with VLA");
+ return;
+ }
+
// If this code is reachable then emit a stop point (if generating
// debug info). We have to do this ourselves because we are on the
// "simple" statement path.