[PATCH] D152096: [Clang] Check for abstract parameters only when functions are defined.

John McCall via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Wed Jun 7 12:18:31 PDT 2023


rjmccall added inline comments.


================
Comment at: clang/test/SemaObjCXX/parameters.mm:14-17
+struct test2 { virtual void foo() = 0; };
 @interface Test2
-- (void) foo: (test2) foo; // expected-error {{parameter type 'test2' is an abstract class}}
+- (void) foo: (test2) foo ;
 @end
----------------
aaron.ballman wrote:
> I think this change makes sense for Objective-C as well (this is a declaration and not a definition, at least as I understand things), but pinging @rjmccall just in case I'm wrong.
No, that's right, methods in `@interface`s and `@protocol`s are just declarations.

Consistency with the base standard seems like the right way to go here, even those I personally find this rule rather silly.  (It's one thing  to allow this for deleted methods, but allowing it for declarations?)


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D152096



More information about the cfe-commits mailing list