"function definition declared 'typedef'">;
def err_at_defs_cxx : Error<"@defs is not supported in Objective-C++">;
def err_at_in_class : Error<"unexpected '@' in member specification">;
+def err_unexpected_semi : Error<"unexpected ';' before %0">;
def err_expected_fn_body : Error<
"expected function body after function declarator">;
if (P.Tok.is(Close)) {
LClose = (P.*Consumer)();
return false;
- }
+ } else if (P.Tok.is(tok::semi) && P.NextToken().is(Close)) {
+ SourceLocation SemiLoc = P.ConsumeToken();
+ P.Diag(SemiLoc, diag::err_unexpected_semi)
+ << Close << FixItHint::CreateRemoval(SourceRange(SemiLoc, SemiLoc));
+ LClose = (P.*Consumer)();
+ return false;
+ }
return diagnoseMissingClose();
}
class BadExceptionSpec {
void f() throw(int; // expected-error {{expected ')'}} expected-note {{to match}}
- void g() throw( // expected-note {{to match}}
- int( // expected-note {{to match}}
- ; // expected-error 2{{expected ')'}} expected-error {{unexpected end of exception specification}}
+ void g() throw(
+ int(
+ ; // expected-error {{unexpected ';' before ')'}}
));
};
--- /dev/null
+// RUN: %clang_cc1 -fsyntax-only -verify %s
+// RUN: cp %s %t.cpp
+// RUN: not %clang_cc1 -fsyntax-only %t.cpp -fixit
+// RUN: %clang_cc1 -fsyntax-only %t.cpp
+
+void test1(int a;) { // expected-error{{unexpected ';' before ')'}}
+ while (a > 5;) {} // expected-error{{unexpected ';' before ')'}}
+ if (int b = 10;) {} // expected-error{{unexpected ';' before ')'}}
+ for (int c = 0; c < 21; ++c;) {} // expected-error{{unexpected ';' before ')'}}
+ int d = int(3 + 4;); // expected-error{{unexpected ';' before ')'}}
+ int e[5;]; // expected-error{{unexpected ';' before ']'}}
+ e[a+1;] = 4; // expected-error{{unexpected ';' before ']'}}
+ int f[] = {1,2,3;}; // expected-error{{unexpected ';' before '}'}}
+}