Skip to content

Commit 66c3b0b

Browse files
committed
Address code review.
1 parent ec903eb commit 66c3b0b

File tree

3 files changed

+22
-2
lines changed

3 files changed

+22
-2
lines changed

clang/docs/ReleaseNotes.rst

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -675,6 +675,9 @@ Improvements to Clang's diagnostics
675675
views.push_back(std::string("123")); // warning
676676
}
677677

678+
- Fixed a bug where Clang hangs on unsupported optional scope specifier ``::`` when parsing
679+
Objective-C. Clang now emits a diagnostic message instead of hanging.
680+
678681
Improvements to Clang's time-trace
679682
----------------------------------
680683

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,13 @@
1-
// RUN: %clang_cc1 -x objective-c -fsyntax-only -verify %s
1+
// RUN: %clang_cc1 -x objective-c -fsyntax-only -Wno-objc-root-class -verify %s
2+
3+
int GV = 42;
24

35
@interface A
4-
- (instancetype)init:(::A *) foo; // expected-error {{expected a type}}
6+
+ (int) getGV;
7+
- (instancetype)init:(::A *) foo; // expected-error {{expected a type}}
8+
@end
9+
10+
@implementation A
11+
+ (int) getGV { return ::GV; } // expected-error {{expected a type}}
12+
- (instancetype)init:(::A *) foo { return self; } // expected-error {{expected a type}}
513
@end
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
// Test to make sure the parser does not get stuck on the optional
2+
// scope specifier on the type B.
3+
// RUN: %clang_cc1 -fsyntax-only %s
4+
5+
class B;
6+
7+
@interface A
8+
- (void) init:(::B *) foo;
9+
@end

0 commit comments

Comments
 (0)