Skip to content

Commit 9220b14

Browse files
committed
[clang] Do not infer lifetimebound for functions with void return type
1 parent 78f690b commit 9220b14

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

clang/lib/Sema/SemaAttr.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -217,7 +217,7 @@ void Sema::inferGslOwnerPointerAttribute(CXXRecordDecl *Record) {
217217
}
218218

219219
void Sema::inferLifetimeBoundAttribute(FunctionDecl *FD) {
220-
if (FD->getNumParams() == 0)
220+
if (FD->getNumParams() == 0 || FD->getReturnType()->isVoidType())
221221
return;
222222

223223
if (unsigned BuiltinID = FD->getBuiltinID()) {

0 commit comments

Comments
 (0)