| 1 |
/* Redeclarations of class names. */ |
| 2 |
/* { dg-do compile } */ |
| 3 |
/* { dg-additional-options "-Wno-objc-root-class" } */ |
| 4 |
|
| 5 |
typedef int foo; /* { dg-line foo_def } */ |
| 6 |
|
| 7 |
@class foo; /* { dg-error "redeclared as different kind of symbol" } */ |
| 8 |
/* { dg-error "previous declaration of" "" { target *-*-* } foo_def } */ |
| 9 |
|
| 10 |
typedef int bar; /* { dg-line bar_def } */ |
| 11 |
|
| 12 |
#if defined(__has_attribute) && __has_attribute(objc_root_class) |
| 13 |
__attribute__((objc_root_class)) |
| 14 |
#endif |
| 15 |
@interface bar |
| 16 |
@end /* { dg-error "redeclared as different kind of symbol" } */ |
| 17 |
/* { dg-error "previous declaration of" "" { target *-*-* } bar_def } */ |
| 18 |
|
| 19 |
int glob; /* { dg-line glob_def } */ |
| 20 |
|
| 21 |
@implementation glob |
| 22 |
@end /* { dg-line glob_impl_end } */ |
| 23 |
/* { dg-error "redeclared as different kind of symbol" "" { target *-*-* } glob_impl_end } */ |
| 24 |
/* { dg-error "previous declaration of" "" { target *-*-* } glob_def } */ |
| 25 |
/* { dg-warning "annot find interface declaration" "" { target *-*-* } glob_impl_end } */ |