Skip to content

Commit

Permalink
Don't error on redefinition of some builtins
Browse files Browse the repository at this point in the history
  • Loading branch information
pgoodman committed Sep 26, 2023
1 parent 76cd95d commit 4ab1f8b
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion clang/lib/Sema/SemaDecl.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -15552,7 +15552,8 @@ Decl *Sema::ActOnStartOfFunctionDef(Scope *FnBodyScope, Decl *D,
// Builtin functions cannot be defined.
if (unsigned BuiltinID = FD->getBuiltinID()) {
if (!Context.BuiltinInfo.isPredefinedLibFunction(BuiltinID) &&
!Context.BuiltinInfo.isPredefinedRuntimeFunction(BuiltinID)) {
!Context.BuiltinInfo.isPredefinedRuntimeFunction(BuiltinID) &&
!Context.BuiltinInfo.isPredefinedPASTAFunction(BuiltinID)) {
Diag(FD->getLocation(), diag::err_builtin_definition) << FD;
FD->setInvalidDecl();
}
Expand Down

0 comments on commit 4ab1f8b

Please sign in to comment.