blob: a7c08555c905a98649ab54f10ce10bed91879b99 [file] [log] [blame]
Daniel Dunbara5728872009-12-15 20:14:24 +00001// RUN: %clang_cc1 -fsyntax-only -verify %s
Steve Naroff13b7c5f2007-08-08 22:15:55 +00002
3struct foo { int a; };
4
5int main() {
6 int a;
7 float b;
8 double d;
9 struct foo s;
10
11 static int ary[__builtin_classify_type(a)];
Anders Carlsson96e05bc2008-12-07 00:20:55 +000012 static int ary2[(__builtin_classify_type)(a)]; // expected-error{{variable length array declaration can not have 'static' storage duration}}
13 static int ary3[(*__builtin_classify_type)(a)]; // expected-error{{variable length array declaration can not have 'static' storage duration}}
Steve Naroff13b7c5f2007-08-08 22:15:55 +000014
15 int result;
16
17 result = __builtin_classify_type(a);
18 result = __builtin_classify_type(b);
19 result = __builtin_classify_type(d);
20 result = __builtin_classify_type(s);
21}