Skip to content

Commit 732309b

Browse files
committed
Round three of addressing code review feedback from Erich Keane.
Changes include: - Use `isTemplated()` instead of `isDependentContext()` since the latter doesn't necessarily handle templated friend functions.
1 parent b9c9109 commit 732309b

File tree

3 files changed

+3
-3
lines changed

3 files changed

+3
-3
lines changed

clang/lib/AST/ASTContext.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14303,7 +14303,7 @@ static SYCLKernelInfo BuildSYCLKernelInfo(CanQualType KernelNameType,
1430314303

1430414304
void ASTContext::registerSYCLEntryPointFunction(FunctionDecl *FD) {
1430514305
assert(!FD->isInvalidDecl());
14306-
assert(!FD->isDependentContext());
14306+
assert(!FD->isTemplated());
1430714307

1430814308
const auto *SKEPAttr = FD->getAttr<SYCLKernelEntryPointAttr>();
1430914309
assert(SKEPAttr && "Missing sycl_kernel_entry_point attribute");

clang/lib/Sema/SemaDecl.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12054,7 +12054,7 @@ bool Sema::CheckFunctionDeclaration(Scope *S, FunctionDecl *NewFD,
1205412054
OpenMP().ActOnFinishedFunctionDefinitionInOpenMPAssumeScope(NewFD);
1205512055

1205612056
if (LangOpts.isSYCL() && NewFD->hasAttr<SYCLKernelEntryPointAttr>() &&
12057-
!NewFD->isInvalidDecl() && !NewFD->isDependentContext())
12057+
!NewFD->isInvalidDecl() && !NewFD->isTemplated())
1205812058
getASTContext().registerSYCLEntryPointFunction(NewFD);
1205912059

1206012060
// Semantic checking for this function declaration (in isolation).

clang/lib/Serialization/ASTReaderDecl.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1159,7 +1159,7 @@ void ASTDeclReader::VisitFunctionDecl(FunctionDecl *FD) {
11591159
// If the declaration is a SYCL kernel entry point function as indicated by
11601160
// the presence of a sycl_kernel_entry_point attribute, register it so that
11611161
// associated metadata is recreated.
1162-
if (!FD->isInvalidDecl() && !FD->isDependentContext() &&
1162+
if (!FD->isInvalidDecl() && !FD->isTemplated() &&
11631163
FD->hasAttr<SYCLKernelEntryPointAttr>()) {
11641164
ASTContext &C = Reader.getContext();
11651165
C.registerSYCLEntryPointFunction(FD);

0 commit comments

Comments
 (0)