File tree Expand file tree Collapse file tree 2 files changed +12
-1
lines changed Expand file tree Collapse file tree 2 files changed +12
-1
lines changed Original file line number Diff line number Diff line change @@ -2222,8 +2222,14 @@ bool Parser::TryAnnotateTypeOrScopeTokenAfterScopeSpec(
22222222 }
22232223 }
22242224
2225- if (SS.isEmpty ())
2225+ if (SS.isEmpty ()) {
2226+ if (getLangOpts ().ObjC && Tok.is (tok::coloncolon)) {
2227+ // ObjectiveC does not allow :: as as a scope token.
2228+ Diag (ConsumeToken (), diag::err_expected_type);
2229+ return true ;
2230+ }
22262231 return false ;
2232+ }
22272233
22282234 // A C++ scope specifier that isn't followed by a typename.
22292235 AnnotateScopeToken (SS, IsNewScope);
Original file line number Diff line number Diff line change 1+ // RUN: %clang_cc1 -x objective-c -fsyntax-only -verify %s
2+
3+ @interface A
4+ - (instancetype )init : (::A *) foo ; // expected-error {{expected a type}}
5+ @end
You can’t perform that action at this time.
0 commit comments