Hello Rafael,

I have added the requested tests.

On Tue, Jan 8, 2013 at 5:46 PM, Rafael Espíndola
<[email protected]> wrote:
> On 7 January 2013 18:00, Dmitri Gribenko <[email protected]> wrote:
>> Hello,
>>
>> GCC implements -Wvla as "warn on every VLA" (this is useful to find
>> every VLA, for example, if they are forbidden by coding guidelines).
>> Currently Clang implements -Wvla as "warn on VLA when it is an
>> extension".
>>
>> The attached patch makes our behavior match GCC.  The existing vla
>> extwarn is moved under -Wvla-extension and is still included into
>> -Wgnu.
>>
>> -Wvla is disabled by default, so I don't think that this change will
>> cause much fallout.
>
> Do you want this to warn (in C) for
>
> void test(int n, int v[n]) {
> }
>
> What about just declaring test? Please add a test for both.

Yes, we want to warn here.  Added tests.

> In c++, do you expect an warning in
>
> template<typename T>
> void test(int n) {
>   int v[n];
> }
>
> Even when the template is never instantiated? Please add a test one
> way or the other.

Added tests.

It is interesting that GCC does not implement VLA extension in C++
completely and errors on everything except test1() in
test/SemaCXX/warn-vla.cpp

Dmitri

-- 
main(i,j){for(i=2;;i++){for(j=2;j<i;j++){if(!(i%j)){j=0;break;}}if
(j){printf("%d\n",i);}}} /*Dmitri Gribenko <[email protected]>*/

Attachment: implement-wvla-correctly-v2.patch
Description: Binary data

_______________________________________________
cfe-commits mailing list
[email protected]
http://lists.cs.uiuc.edu/mailman/listinfo/cfe-commits

Reply via email to