Skip to content

Commit fdab756

Browse files
tambrytstellar
authored andcommitted
[Sema] Handle objc_super special lookup when checking builtin compatibility
objc_super is special and needs LookupPredefedObjCSuperType() called before performing builtin type comparisons. This fixes an error when compiling macOS headers. A test is added. Differential Revision: https://reviews.llvm.org/D87917
1 parent adf8453 commit fdab756

File tree

2 files changed

+9
-0
lines changed

2 files changed

+9
-0
lines changed

clang/lib/Sema/SemaDecl.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9643,6 +9643,7 @@ Sema::ActOnFunctionDeclarator(Scope *S, Declarator &D, DeclContext *DC,
96439643
NewFD->addAttr(BuiltinAttr::CreateImplicit(Context, BuiltinID));
96449644
} else {
96459645
ASTContext::GetBuiltinTypeError Error;
9646+
LookupPredefedObjCSuperType(*this, S, NewFD->getIdentifier());
96469647
QualType BuiltinType = Context.GetBuiltinType(BuiltinID, Error);
96479648

96489649
if (!Error && !BuiltinType.isNull() &&
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
// RUN: %clang_cc1 -verify %s
2+
// expected-no-diagnostics
3+
4+
// objc_super has special lookup rules for compatibility with macOS headers, so
5+
// the following should compile.
6+
struct objc_super {};
7+
extern "C" id objc_msgSendSuper(struct objc_super *super, SEL op, ...);
8+
extern "C" void objc_msgSendSuper_stret(struct objc_super *super, SEL op, ...);

0 commit comments

Comments
 (0)