llvm-project/clang/test/Parser/objcxx-coloncolon.mm
Qiongsi Wu 1418018502
[clang][ObjectiveC] Fix Parsing the :: Optional Scope Specifier (#119908)
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
2024-12-20 09:47:26 -08:00

10 lines
193 B
Plaintext

// Test to make sure the parser does not get stuck on the optional
// scope specifier on the type B.
// RUN: %clang_cc1 -fsyntax-only %s
class B;
@interface A
- (void) init:(::B *) foo;
@end