llvm-for-llvmta/tools/clang/test/Parser/extra-semi.cpp

14 lines
638 B
C++
Raw Permalink Normal View History

2022-04-25 13:02:35 +02:00
// 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 ')'}}
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 '}'}}
}