Skip to content

Commit b953d80

Browse files
Undo assert
1 parent 49c8ba5 commit b953d80

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

clang/lib/Sema/SemaSYCL.cpp

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2845,9 +2845,11 @@ class SYCLKernelNameTypeVisitor
28452845
bool isValid() { return !IsInvalid; }
28462846

28472847
bool Visit(QualType T) {
2848-
assert(!T.isNull() && "KernelNameType cannot be null");
2848+
if (T.isNull())
2849+
return false;
28492850
const CXXRecordDecl *RD = T->getAsCXXRecordDecl();
2850-
assert(RD && "KernelNameType is not a record");
2851+
if (!RD)
2852+
return false;
28512853
// If KernelNameType has template args visit each template arg via
28522854
// ConstTemplateArgumentVisitor
28532855
if (const auto *TSD = dyn_cast<ClassTemplateSpecializationDecl>(RD)) {
@@ -2862,7 +2864,8 @@ class SYCLKernelNameTypeVisitor
28622864
}
28632865

28642866
bool Visit(const TemplateArgument &TA) {
2865-
assert(!TA.isNull() && "TemplateArgument cannot be null");
2867+
if (TA.isNull())
2868+
return false;
28662869
return InnerTAVisitor::Visit(TA);
28672870
}
28682871

0 commit comments

Comments
 (0)