blob: 785ea0efa4013561c03a0ea55e8bfe70bbed0e8b [file] [log] [blame]
Daniel Dunbard7d5f022009-03-24 02:24:46 +00001// RUN: clang-cc -fsyntax-only -verify %s
Sebastian Redl4a4251b2009-02-07 13:06:23 +00002
3// C++-specific tests for integral constant expressions.
4
5const int c = 10;
6int ar[c];
Douglas Gregor59600d82009-09-10 17:44:23 +00007
8struct X0 {
9 static const int value = static_cast<int>(4.0);
10};
Douglas Gregorf2991242009-09-10 23:31:45 +000011
12void f() {
13 if (const int value = 17) {
14 int array[value];
15 }
16}