| 1 |
// RUN: %clang_cc1 -fsyntax-only -verify -Wvla %s |
| 2 |
|
| 3 |
void test1(int n) { // expected-note {{here}} |
| 4 |
int v[n]; // expected-warning {{variable length array}} expected-note {{parameter 'n'}} |
| 5 |
} |
| 6 |
|
| 7 |
void test2(int n, int v[n]) { // expected-warning {{variable length array}} expected-note {{parameter 'n'}} expected-note {{here}} |
| 8 |
} |
| 9 |
|
| 10 |
void test3(int n, int v[n]); // expected-warning {{variable length array}} expected-note {{parameter 'n'}} expected-note {{here}} |
| 11 |
|
| 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'}} |
| 15 |
} |
| 16 |
|
| 17 |
template<typename T> |
| 18 |
void test5(int n, int v[n]) { // expected-warning {{variable length array}} expected-note {{parameter 'n'}} expected-note {{here}} |
| 19 |
} |
| 20 |
|
| 21 |
template<typename T> |
| 22 |
void test6(int n, int v[n]); // expected-warning {{variable length array}} expected-note {{parameter 'n'}} expected-note {{here}} |
| 23 |
|
| 24 |
template<typename T> |
| 25 |
void test7(int n, T v[n]) { // expected-warning {{variable length array}} expected-note {{parameter 'n'}} expected-note {{here}} |
| 26 |
} |
| 27 |
|