зеркало из https://github.com/microsoft/clang.git
Don't consume tokens past the end-of-file in an @interface. Fixes
<rdar://problem/7735566>. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@98613 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Родитель
6c790eac94
Коммит
c3d43b783d
|
@ -183,6 +183,7 @@ def err_objc_no_attributes_on_category : Error<
|
|||
def err_objc_missing_end : Error<"missing @end">;
|
||||
def warn_objc_protocol_qualifier_missing_id : Warning<
|
||||
"protocol qualifiers without 'id' is archaic">;
|
||||
def err_objc_unknown_at : Error<"expected an Objective-C directive after '@'">;
|
||||
|
||||
def err_objc_illegal_visibility_spec : Error<
|
||||
"illegal visibility specification">;
|
||||
|
|
|
@ -294,6 +294,8 @@ void CompilerInstance::createCodeCompletionConsumer() {
|
|||
getFrontendOpts().DebugCodeCompletionPrinter,
|
||||
getFrontendOpts().ShowMacrosInCodeCompletion,
|
||||
llvm::outs()));
|
||||
if (!CompletionConsumer)
|
||||
return;
|
||||
|
||||
if (CompletionConsumer->isOutputBinary() &&
|
||||
llvm::sys::Program::ChangeStdoutToBinary()) {
|
||||
|
|
|
@ -375,6 +375,10 @@ void Parser::ParseObjCInterfaceDeclList(DeclPtrTy interfaceDecl,
|
|||
AtEnd.setBegin(AtLoc);
|
||||
AtEnd.setEnd(Tok.getLocation());
|
||||
break;
|
||||
} else if (DirectiveKind == tok::objc_not_keyword) {
|
||||
Diag(Tok, diag::err_objc_unknown_at);
|
||||
SkipUntil(tok::semi);
|
||||
continue;
|
||||
}
|
||||
|
||||
// Eat the identifier.
|
||||
|
|
|
@ -0,0 +1,7 @@
|
|||
// RUN: %clang_cc1 -fsyntax-only -verify %s
|
||||
|
||||
@interface AAA
|
||||
{
|
||||
}
|
||||
@ x// expected-error{{expected an Objective-C directive after '@'}}
|
||||
// expected-error{{missing @end}}
|
Загрузка…
Ссылка в новой задаче