Skip to content

Commit 461dde6

Browse files
committed
[SYCL] Forbid non-const static variable uses in device code (fix intel#6)
Signed-off-by: Aleksander Fadeev <aleksander.fadeev@intel.com>
1 parent 6f812ac commit 461dde6

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

clang/lib/Sema/SemaExpr.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -211,7 +211,7 @@ bool Sema::DiagnoseUseOfDecl(NamedDecl *D, ArrayRef<SourceLocation> Locs,
211211
bool AvoidPartialAvailabilityChecks,
212212
ObjCInterfaceDecl *ClassReceiver) {
213213
if (getLangOpts().SYCLIsDevice) {
214-
if (auto VD = dyn_cast<VarDecl>(D))
214+
if (auto VD = dyn_cast<VarDecl>(D))
215215
if (VD->getStorageClass() == SC_Static &&
216216
!VD->getType().isConstant(Context))
217217
SYCLDiagIfDeviceCode(*Locs.begin(), diag::err_sycl_restrict)

0 commit comments

Comments
 (0)