From 298b4b8b5bbfbaff0538e8da8813b1498e06d212 Mon Sep 17 00:00:00 2001 From: evghenii Date: Thu, 2 Jan 2014 13:16:14 +0100 Subject: [PATCH] +1 --- stmt.cpp | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/stmt.cpp b/stmt.cpp index fd85f60f..67d0d96a 100644 --- a/stmt.cpp +++ b/stmt.cpp @@ -206,6 +206,11 @@ DeclStmt::EmitCode(FunctionEmitContext *ctx) const { } if (sym->storageClass == SC_STATIC) { + if (g->target->getISA() == Target::NVPTX64) + if (!sym->type->IsConstType()) + Error(initExpr->pos, "Non-constant static variable ""\"%s\" is not supported with ""\"cuda\" target.", + sym->name.c_str()); + // For static variables, we need a compile-time constant value // for its initializer; if there's no initializer, we use a // zero value.