blob: 5b07842929923b20bc5ca75bd473c35c91a53960 [file] [log] [blame]
Douglas Gregor87c30072010-07-26 04:08:02 +00001// RUN: %clang_cc1 -fsyntax-only -verify %s
Cedric Venet3d658642009-02-14 20:20:19 +00002
3void f() {
4 int a;
5 while (a) ;
6 while (int x) ; // expected-error {{expected '=' after declarator}}
7 while (float x = 0) ;
Dmitri Gribenko625bb562012-02-14 22:14:32 +00008 if (const int x = a) ; // expected-warning{{empty body}} expected-note{{put the semicolon on a separate line to silence this warning}}
Cedric Venet3d658642009-02-14 20:20:19 +00009 switch (int x = a+10) {}
10 for (; int x = ++a; ) ;
11}