
The parser hangs when processing types/variables prefixed by `::` as an optional scope specifier. For example, ``` - (instancetype)init:(::A *) foo; ``` The parser should not hang, and it should emit an error. This PR implements the error check. rdar://140885078
20 lines
608 B
Objective-C
20 lines
608 B
Objective-C
// RUN: %clang_cc1 -x objective-c -fsyntax-only -Wno-objc-root-class -verify %s
|
|
|
|
int GV = 42;
|
|
|
|
@interface A
|
|
+ (int) getGV;
|
|
- (instancetype)init:(::A *) foo; // expected-error {{expected a type}}
|
|
@end
|
|
|
|
@implementation A
|
|
- (void)performSelector:(SEL)selector {}
|
|
- (void)double:(int)firstArg :(int)secondArg colon:(int)thirdArg {}
|
|
- (void)test {
|
|
// The `::` below should not trigger an error.
|
|
[self performSelector:@selector(double::colon:)];
|
|
}
|
|
+ (int) getGV { return ::GV; } // expected-error {{expected a type}}
|
|
- (instancetype)init:(::A *) foo { return self; } // expected-error {{expected a type}}
|
|
@end
|