Mixing __attribute__((objc_requires_super)) and IBAction triggers a warning

Originator:nicolas.bouilleaud
Number:rdar://14251387 Date Originated:2013-06-24
Status:Closed (Resolved) Resolved:2013-12-19
Product:Developer Tools Product Version:5.0
Classification:Other bug Reproducible:Always
 
Summary:

Using __attribute__((objc_requires_super)) on a method flagged with IBAction triggers the warning "mismatched-method-attributes"

Steps to Reproduce:

Given the ViewController.h:

@interface ViewController : UIViewController
- (void) someMethodRequiringSuper __attribute__((objc_requires_super));
- (IBAction) someAction;
- (IBAction) someActionRequiringSuper __attribute__((objc_requires_super));
@end

and implementation:

@implementation ViewController
- (void) someMethodRequiringSuper
{
}
- (IBAction) someAction
{
}
- (IBAction) someActionRequiringSuper
{
}
@end

Expected Results:

Should compile without a word.

Actual Results:

The first two methods do not pose a problem, but clang issues the following warning for the last method (edited for clarity):

>ViewController.m:23:1: warning: attributes on method implementation and its declaration must match [-Wmismatched-method-attributes]
>{
>^
>In file included from ViewController.m:9:
>ViewController.h:14:1: note: method 'someActionRequiringSuper' declared here
>- (IBAction) someActionRequiringSuper __attribute__((objc_requires_super));
>^
>1 warning generated.

Regression:

Never worked correctly.

Notes:

Comments

Fixed in Xcode 5.1dp2

By nicolas.bouilleaud at Dec. 19, 2013, 9:45 a.m. (reply...)

Please note: Reports posted here will not necessarily be seen by Apple. All problems should be submitted at bugreport.apple.com before they are posted here. Please only post information for Radars that you have filed yourself, and please do not include Apple confidential information in your posts. Thank you!