diff --git a/clang/lib/Parse/ParseExpr.cpp b/clang/lib/Parse/ParseExpr.cpp index d65a3ec279deb7e3829b17978c9c0f8a6e79a58e..abd3ccd2bbf83bf334a653fe80efe429ec220e1d 100644 --- a/clang/lib/Parse/ParseExpr.cpp +++ b/clang/lib/Parse/ParseExpr.cpp @@ -1073,9 +1073,9 @@ ExprResult Parser::ParseCastExpression( return ParseOptionalBSCScopeSpecifier( ParseKind, isAddressOfOperand, NotCastExpr, isTypeCast, isVectorLiteral, NotPrimaryExpression, HasBSCScopeSpec); + } else { + return ExprError(); } - // Fall through; this isn't a message send. - LLVM_FALLTHROUGH; #endif case tok::identifier: { // primary-expression: identifier diff --git a/clang/test/BSC/Negative/Generic/StructAndFunction/struct_parse_fuzz_fix/struct_parse_fuzz_fix.cbs b/clang/test/BSC/Negative/Generic/StructAndFunction/struct_parse_fuzz_fix/struct_parse_fuzz_fix.cbs new file mode 100644 index 0000000000000000000000000000000000000000..b64942fce3518c458cf8c56a9b40d890add2f123 --- /dev/null +++ b/clang/test/BSC/Negative/Generic/StructAndFunction/struct_parse_fuzz_fix/struct_parse_fuzz_fix.cbs @@ -0,0 +1,26 @@ +// RUN: %clang_cc1 -fsyntax-only -verify %s + +void func1(){ + +struct SomeStruct; // expected-error{{explicit specialization of undeclared template struct 'SomeStruct'}} +} + +void func2(){ + -struct SomeStruct; // expected-error{{explicit specialization of undeclared template struct 'SomeStruct'}} +} + +void func3(){ + *struct SomeStruct; // expected-error{{explicit specialization of undeclared template struct 'SomeStruct'}} +} + +void func4(){ + \struct SomeStruct; // expected-error{{expected expression}} +} + +void func5(){ + >struct SomeStruct; // expected-error{{expected expression}} expected-error{{explicit specialization of undeclared template struct 'SomeStruct'}} +} + +void func6(int n) { // expected-note{{to match this '{'}} + switch (n) { // expected-note{{to match this '{'}} + g_noise.getTaskCount+;+ // expected-error{{use of undeclared identifier 'g_noise'}} expected-error{{expected expression}} + struct PollResult s = task->future->poll(); // expected-error{{explicit specialization of undeclared template struct 'PollResult'}} expected-error{{expected '}'}} expected-error{{expected '}'}}