| 1 |
// RUN: %clang_cc1 -fsyntax-only -verify %s |
| 2 |
|
| 3 |
while // expected-error {{while loop outside of a function}} |
| 4 |
(true) {}; |
| 5 |
|
| 6 |
// without semicolon |
| 7 |
while // expected-error {{while loop outside of a function}} |
| 8 |
(true) {} |
| 9 |
|
| 10 |
do { // expected-error {{expected unqualified-id}} |
| 11 |
int some_var = 1; |
| 12 |
some_var += 3; |
| 13 |
} |
| 14 |
while // expected-error {{while loop outside of a function}} |
| 15 |
(true); |
| 16 |
|
| 17 |
void someFunction() { |
| 18 |
while(true) {}; |
| 19 |
} |
| 20 |
|
| 21 |
class SomeClass { |
| 22 |
public: |
| 23 |
while(true) {} // expected-error {{expected member name or ';' after declaration specifiers}} |
| 24 |
void some_fn() { |
| 25 |
while(true) {} |
| 26 |
} |
| 27 |
}; |