lanza added a comment.

A concern that has come up while rewriting this for the listed concerns is 
forward declared protocols that are defined as `non_runtime`.

  @protocol NonRuntimeProto;
  
  @interface Implementer : Root <NonRuntimeProto>
  @end
  
  @implementation Implementer
  ...
  @end

This compiles just fine but with a warning in clang 12. It'll emit a reference 
to the `NonRuntimeProto` without ever having had the chance to see the 
`objc_non_runtime_protocol` defined elsewhere and will thus error out at link.

There's a few ways to move forward with this:

1. Ignore it. If the user decided that a protocol was 
`objc_non_runtime_protocol` they probably have the insight necessary to address 
this link error. This is no more difficult than many C++ linker errors to 
diagnose.
2. Make it an error if the protocol is not defined prior to the implementation 
but leave forward-decls as valid for interfaces.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D75574

_______________________________________________
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to