brintos

brintos / llvm-project-archived public Read only

0
0
Text · 1.0 KiB · 00ac7c7 Raw
28 lines · cpp
1// RUN: %clang_cc1 -fsyntax-only -verify -Wvla %s2 3void test1(int n) { // expected-note {{here}}4  int v[n]; // expected-warning {{variable length array}} expected-note {{parameter 'n'}}5}6 7void test2(int n, int v[n]) { // expected-warning {{variable length array}} expected-note {{parameter 'n'}} expected-note {{here}}8}9 10void test3(int n, int v[n]); // expected-warning {{variable length array}} expected-note {{parameter 'n'}} expected-note {{here}}11 12template<typename T>13void test4(int n) { // expected-note {{here}}14  int v[n]; // expected-warning {{variable length array}} expected-note {{parameter 'n'}}15}16 17template<typename T>18void test5(int n, int v[n]) { // expected-warning {{variable length array}} expected-note {{parameter 'n'}} expected-note {{here}}19}20 21template<typename T>22void test6(int n, int v[n]); // expected-warning {{variable length array}} expected-note {{parameter 'n'}} expected-note {{here}}23 24template<typename T>25void test7(int n, T v[n]) { // expected-warning {{variable length array}} expected-note {{parameter 'n'}} expected-note {{here}}26}27 28