Skip to content

Commit

Permalink
Totally disable the warning about builtin decls.
Browse files Browse the repository at this point in the history
  • Loading branch information
pgoodman committed Sep 27, 2023
1 parent 4ab1f8b commit 6afc10b
Showing 1 changed file with 0 additions and 10 deletions.
10 changes: 0 additions & 10 deletions clang/lib/Sema/SemaDecl.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -15549,16 +15549,6 @@ Decl *Sema::ActOnStartOfFunctionDef(Scope *FnBodyScope, Decl *D,
PushFunctionScope();
}

// Builtin functions cannot be defined.
if (unsigned BuiltinID = FD->getBuiltinID()) {
if (!Context.BuiltinInfo.isPredefinedLibFunction(BuiltinID) &&
!Context.BuiltinInfo.isPredefinedRuntimeFunction(BuiltinID) &&
!Context.BuiltinInfo.isPredefinedPASTAFunction(BuiltinID)) {
Diag(FD->getLocation(), diag::err_builtin_definition) << FD;
FD->setInvalidDecl();
}
}

// The return type of a function definition must be complete (C99 6.9.1p3).
// C++23 [dcl.fct.def.general]/p2
// The type of [...] the return for a function definition
Expand Down

0 comments on commit 6afc10b

Please sign in to comment.