blob: cd57eac9a4938dc0f0be0258a086a75acf1a2979 [file] [log] [blame]
Chris Lattnerb3ff0822007-12-18 07:15:40 +00001// RUN: clang %s -verify -fsyntax-only
2
3int test1() {
4 typedef int x[test1()]; // vla
Chris Lattner1543ae92008-08-10 01:58:45 +00005 static int y = sizeof(x); // expected-error {{not a compile-time constant}}
Chris Lattnerb3ff0822007-12-18 07:15:40 +00006}
7
Eli Friedman19bf5c62008-05-21 05:06:46 +00008// PR2347
9void f (unsigned int m)
10{
Eli Friedman45cd28f2008-05-21 05:37:55 +000011 int e[2][m];
Eli Friedman19bf5c62008-05-21 05:06:46 +000012
13 e[0][0] = 0;
14}
15
Chris Lattnerfa1b4e52008-11-12 21:25:45 +000016// PR3048
Chris Lattnerc0332b92008-11-23 23:38:26 +000017int x = sizeof(struct{char qq[x];}); // expected-error {{fields must have a constant size}
Chris Lattnerfa1b4e52008-11-12 21:25:45 +000018