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