f4a2713ac8
Change-Id: Ia40e9ffdf29b5dab2f122f673ff6802a58bc690f
64 lines
1.6 KiB
Text
64 lines
1.6 KiB
Text
// RUN: %clang_cc1 -fsyntax-only -verify -Wno-objc-root-class %s
|
|
|
|
@interface StopAtAtEnd
|
|
// This used to eat the @end
|
|
int 123 // expected-error{{expected unqualified-id}}
|
|
@end
|
|
|
|
@implementation StopAtAtEnd // no-warning
|
|
int 123 // expected-error{{expected unqualified-id}}
|
|
@end
|
|
|
|
|
|
@interface StopAtMethodDecls
|
|
// This used to eat the method declarations
|
|
int 123 // expected-error{{expected unqualified-id}}
|
|
- (void)foo; // expected-note{{here}}
|
|
int 456 // expected-error{{expected unqualified-id}}
|
|
+ (void)bar; // expected-note{{here}}
|
|
@end
|
|
|
|
@implementation StopAtMethodDecls
|
|
int 123 // expected-error{{expected unqualified-id}}
|
|
- (id)foo {} // expected-warning{{conflicting return type}}
|
|
int 456 // expected-error{{expected unqualified-id}}
|
|
+ (id)bar {} // expected-warning{{conflicting return type}}
|
|
@end
|
|
|
|
|
|
@interface EmbeddedNamespace
|
|
// This used to cause an infinite loop.
|
|
namespace NS { // expected-error{{expected unqualified-id}}
|
|
}
|
|
- (id)test; // expected-note{{here}}
|
|
@end
|
|
|
|
@implementation EmbeddedNamespace
|
|
int 123 // expected-error{{expected unqualified-id}}
|
|
// We should still stop here and parse this namespace.
|
|
namespace NS {
|
|
void foo();
|
|
}
|
|
|
|
// Make sure the declaration of -test was recognized.
|
|
- (void)test { // expected-warning{{conflicting return type}}
|
|
// Make sure the declaration of NS::foo was recognized.
|
|
NS::foo();
|
|
}
|
|
|
|
@end
|
|
|
|
|
|
@protocol ProtocolWithEmbeddedNamespace
|
|
namespace NS { // expected-error{{expected unqualified-id}}
|
|
|
|
}
|
|
- (void)PWEN_foo; // expected-note{{here}}
|
|
@end
|
|
|
|
@interface ImplementPWEN <ProtocolWithEmbeddedNamespace>
|
|
@end
|
|
|
|
@implementation ImplementPWEN
|
|
- (id)PWEN_foo {} // expected-warning{{conflicting return type}}
|
|
@end
|