Skip to content

Commit 6fd86bf

Browse files
Fix failing test
1 parent e77b134 commit 6fd86bf

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

clang/lib/Sema/SemaSYCL.cpp

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2416,6 +2416,8 @@ static bool isESIMDKernelType(const CXXRecordDecl *KernelObjType) {
24162416
// (of either the lambda or the function object).
24172417
static bool IsCallOperatorDefined(const CXXRecordDecl *KernelObjType) {
24182418
const CXXMethodDecl *CallOperator = nullptr;
2419+
if (!KernelObjType)
2420+
return false;
24192421
if (KernelObjType->isLambda())
24202422
CallOperator = KernelObjType->getLambdaCallOperator();
24212423
else
@@ -3469,7 +3471,7 @@ void Sema::CheckSYCLKernelCall(FunctionDecl *KernelFunc, SourceRange CallLoc,
34693471
GetSYCLKernelObjectType(KernelFunc)->getAsCXXRecordDecl();
34703472

34713473
bool IsKernelTypeValid = IsCallOperatorDefined(KernelObj);
3472-
if (!KernelObj || !IsKernelTypeValid) {
3474+
if (!IsKernelTypeValid) {
34733475
Diag(Args[0]->getExprLoc(), diag::err_sycl_kernel_not_function_object);
34743476
KernelFunc->setInvalidDecl();
34753477
return;

0 commit comments

Comments
 (0)