[cfe-dev] objc_subclassing_restricted attribute bug

Alfred Zien via cfe-dev cfe-dev at lists.llvm.org
Thu Oct 13 05:30:57 PDT 2016


Hi! Found a bug. If you add objc_subclassing_restricted attribute to both parent and child classes it compiles without any error. So attribute appears to be useless, as you can't rely on it.

Code to reproduce bug:

#import <Foundation/Foundation.h>

#define FINAL __attribute__((objc_subclassing_restricted))

FINAL
@interface Parent : NSObject
@end
@implementation Parent
@end

FINAL
@interface Child : Parent
@end
@implementation Child
@end

int main(int argc, const char * argv[]) {
  return 0;
}



-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/cfe-dev/attachments/20161013/179a58c5/attachment.html>


More information about the cfe-dev mailing list