diff --git a/clang/lib/Parse/ParseDecl.cpp b/clang/lib/Parse/ParseDecl.cpp index 41e3a4bb78f57d5f4eadf9f53d9053afdd98633c..a51f5add7dfdbbb86b5202be8f56fc3b71e79892 100644 --- a/clang/lib/Parse/ParseDecl.cpp +++ b/clang/lib/Parse/ParseDecl.cpp @@ -5671,7 +5671,6 @@ static bool isPipeDeclerator(const Declarator &D) { } bool Parser::IsBSCMethodAmbiguous() { - assert(NextToken().isNot(tok::eof)); if (GetLookAheadToken(2).isNot(tok::coloncolon)) { bool FlagUnsigned = (Tok.is(tok::kw_unsigned) && NextToken().isOneOf(tok::kw_int, tok::kw_short, diff --git a/clang/test/BSC/Method/Struct/struct_error_function_definition.cbs b/clang/test/BSC/Method/Struct/struct_error_function_definition.cbs new file mode 100644 index 0000000000000000000000000000000000000000..a02ac305ffaf6946d4ef6fabb4709b7f8e592a1b --- /dev/null +++ b/clang/test/BSC/Method/Struct/struct_error_function_definition.cbs @@ -0,0 +1,6 @@ +// RUN: %clang_cc1 -verify %s + +struct PollResult_int {}; + +struct struct PollResult_int PollResult_int::completed(struct PollResult_int *this, int result) { // expected-error {{declaration of anonymous struct must be a definition}} +} // expected-error {{expected identifier or '('}}