| 1 |
/* Contributed by Igor Seleznev <[email protected]>. */ |
| 2 |
/* This used to be broken. */ |
| 3 |
/* { dg-additional-options "-Wno-objc-root-class" } */ |
| 4 |
|
| 5 |
#include <objc/objc.h> |
| 6 |
|
| 7 |
@interface A |
| 8 |
+ (A *)currentContext; |
| 9 |
@end |
| 10 |
|
| 11 |
@interface B |
| 12 |
+ (B *)currentContext; |
| 13 |
@end |
| 14 |
|
| 15 |
int main() |
| 16 |
{ |
| 17 |
[A currentContext]; /* { dg-bogus "multiple declarations" } */ |
| 18 |
return 0; |
| 19 |
} |
| 20 |
|
| 21 |
@implementation A |
| 22 |
+ (A *)currentContext { return nil; } |
| 23 |
@end |
| 24 |
@implementation B |
| 25 |
+ (B *)currentContext { return nil; } |
| 26 |
@end |