diff --git a/clang/lib/Sema/SemaDecl.cpp b/clang/lib/Sema/SemaDecl.cpp --- a/clang/lib/Sema/SemaDecl.cpp +++ b/clang/lib/Sema/SemaDecl.cpp @@ -9671,6 +9671,7 @@ NewFD->addAttr(BuiltinAttr::CreateImplicit(Context, BuiltinID)); } else { ASTContext::GetBuiltinTypeError Error; + LookupPredefedObjCSuperType(*this, S, NewFD->getIdentifier()); QualType BuiltinType = Context.GetBuiltinType(BuiltinID, Error); if (!Error && !BuiltinType.isNull() && diff --git a/clang/test/SemaObjCXX/builtin-objcsuper.mm b/clang/test/SemaObjCXX/builtin-objcsuper.mm new file mode 100644 --- /dev/null +++ b/clang/test/SemaObjCXX/builtin-objcsuper.mm @@ -0,0 +1,8 @@ +// RUN: %clang_cc1 -verify %s +// expected-no-diagnostics + +// objc_super has special lookup rules for compatibility with macOS headers, so +// the following should compile. +struct objc_super {}; +extern "C" id objc_msgSendSuper(struct objc_super *super, SEL op, ...); +extern "C" void objc_msgSendSuper_stret(struct objc_super *super, SEL op, ...);