Daniel Dunbar | d7d5f02 | 2009-03-24 02:24:46 +0000 | [diff] [blame] | 1 | // RUN: clang-cc -fsyntax-only -verify %s |
Sebastian Redl | 4a4251b | 2009-02-07 13:06:23 +0000 | [diff] [blame] | 2 | |
| 3 | // C++-specific tests for integral constant expressions. |
| 4 | |
| 5 | const int c = 10; |
| 6 | int ar[c]; |
Douglas Gregor | 59600d8 | 2009-09-10 17:44:23 +0000 | [diff] [blame] | 7 | |
| 8 | struct X0 { |
| 9 | static const int value = static_cast<int>(4.0); |
| 10 | }; |
Douglas Gregor | f299124 | 2009-09-10 23:31:45 +0000 | [diff] [blame] | 11 | |
| 12 | void f() { |
| 13 | if (const int value = 17) { |
| 14 | int array[value]; |
| 15 | } |
| 16 | } |