diff options
| author | Dimitry Andric <dim@FreeBSD.org> | 2014-11-24 09:15:30 +0000 |
|---|---|---|
| committer | Dimitry Andric <dim@FreeBSD.org> | 2014-11-24 09:15:30 +0000 |
| commit | 9f4dbff6669c8037f3b036bcf580d14f1a4f12a5 (patch) | |
| tree | 47df2c12b57214af6c31e47404b005675b8b7ffc /test/SemaCXX/c99-variable-length-array.cpp | |
| parent | f73d5f23a889b93d89ddef61ac0995df40286bb8 (diff) | |
Notes
Diffstat (limited to 'test/SemaCXX/c99-variable-length-array.cpp')
| -rw-r--r-- | test/SemaCXX/c99-variable-length-array.cpp | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/test/SemaCXX/c99-variable-length-array.cpp b/test/SemaCXX/c99-variable-length-array.cpp index bb620c71fa07..237f56458dab 100644 --- a/test/SemaCXX/c99-variable-length-array.cpp +++ b/test/SemaCXX/c99-variable-length-array.cpp @@ -140,3 +140,24 @@ namespace PR11744 { } int test = f<int>(0); // expected-note {{instantiation of}} } + +namespace pr18633 { + struct A1 { + static const int sz; + static const int sz2; + }; + const int A1::sz2 = 11; + template<typename T> + void func () { + int arr[A1::sz]; // expected-warning{{variable length arrays are a C99 feature}} + } + template<typename T> + void func2 () { + int arr[A1::sz2]; + } + const int A1::sz = 12; + void func2() { + func<int>(); + func2<int>(); + } +} |
