[PATCH] D87917: [Sema] Handle objc_super special lookup when checking builtin compatibility

Raul Tambre via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Fri Sep 18 10:52:06 PDT 2020


This revision was not accepted when it landed; it landed in state "Needs Review".
This revision was automatically updated to reflect the committed changes.
Closed by commit rGa1aa330b202f: [Sema] Handle objc_super special lookup when checking builtin compatibility (authored by tambre).

Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D87917/new/

https://reviews.llvm.org/D87917

Files:
  clang/lib/Sema/SemaDecl.cpp
  clang/test/SemaObjCXX/builtin-objcsuper.mm


Index: clang/test/SemaObjCXX/builtin-objcsuper.mm
===================================================================
--- /dev/null
+++ 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, ...);
Index: clang/lib/Sema/SemaDecl.cpp
===================================================================
--- clang/lib/Sema/SemaDecl.cpp
+++ 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() &&


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D87917.292844.patch
Type: text/x-patch
Size: 1095 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20200918/80cde441/attachment-0001.bin>


More information about the cfe-commits mailing list