diff options
author | dim <dim@FreeBSD.org> | 2014-11-24 09:15:30 +0000 |
---|---|---|
committer | dim <dim@FreeBSD.org> | 2014-11-24 09:15:30 +0000 |
commit | 173a4f43a911175643bda81ee675e8d9269056ea (patch) | |
tree | 47df2c12b57214af6c31e47404b005675b8b7ffc /test/SemaCXX/c99-variable-length-array.cpp | |
parent | 88f7a7d5251a2d813460274c92decc143a11569b (diff) | |
download | FreeBSD-src-173a4f43a911175643bda81ee675e8d9269056ea.zip FreeBSD-src-173a4f43a911175643bda81ee675e8d9269056ea.tar.gz |
Vendor import of clang RELEASE_350/final tag r216957 (effectively, 3.5.0 release):
https://llvm.org/svn/llvm-project/cfe/tags/RELEASE_350/final@216957
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 bb620c7..237f564 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>(); + } +} |