[PATCH] D49462: [ObjC] Error out when using forward-declared protocol in a @protocol expression
Alex Lorenz via Phabricator via cfe-commits
cfe-commits at lists.llvm.org
Fri Aug 17 11:19:05 PDT 2018
arphaman added inline comments.
================
Comment at: test/CodeGenObjC/forward-declare-protocol-gnu.m:6
-Protocol *getProtocol(void)
-{
- return @protocol(P);
-}
+ at interface I <P>
+ at end
----------------
rjmccall wrote:
> arphaman wrote:
> > rjmccall wrote:
> > > Does this really not require a definition of `P`? Ugh. I wonder if that's reasonable to fix, too.
> > Nope, we don't emit the protocol metadata for it. It might make sense to require the definition with the implementation?
> Yeah, I think so. I would argue that there no places where we should be emitting metadata for an incomplete protocol.
Ok, makes sense.
I will fix it in a follow-up patch then. I don't want to block this change as this patch fixes some nasty runtime issues. I will run a separate source compatibility assessment for the follow-up.
Repository:
rC Clang
https://reviews.llvm.org/D49462
More information about the cfe-commits
mailing list