[docs] Add LICENSE.txt to the root of the mono-repo
[llvm-project.git] / clang / test / SemaCXX / warn-vla.cpp
blob00ac7c7a5c4772cd5259a2e4e99ffb6397b40904
1 // RUN: %clang_cc1 -fsyntax-only -verify -Wvla %s
3 void test1(int n) { // expected-note {{here}}
4 int v[n]; // expected-warning {{variable length array}} expected-note {{parameter 'n'}}
7 void test2(int n, int v[n]) { // expected-warning {{variable length array}} expected-note {{parameter 'n'}} expected-note {{here}}
10 void test3(int n, int v[n]); // expected-warning {{variable length array}} expected-note {{parameter 'n'}} expected-note {{here}}
12 template<typename T>
13 void test4(int n) { // expected-note {{here}}
14 int v[n]; // expected-warning {{variable length array}} expected-note {{parameter 'n'}}
17 template<typename T>
18 void test5(int n, int v[n]) { // expected-warning {{variable length array}} expected-note {{parameter 'n'}} expected-note {{here}}
21 template<typename T>
22 void test6(int n, int v[n]); // expected-warning {{variable length array}} expected-note {{parameter 'n'}} expected-note {{here}}
24 template<typename T>
25 void test7(int n, T v[n]) { // expected-warning {{variable length array}} expected-note {{parameter 'n'}} expected-note {{here}}