[clang] [Clang] Don't diagnose VLA for `-std=gnu++*` by default (PR #89943)

Kolya Panchenko via cfe-commits cfe-commits at lists.llvm.org
Wed Apr 24 09:40:04 PDT 2024


nikolaypanchenko wrote:

> This was discussed in this RFC: https://discourse.llvm.org/t/rfc-diagnosing-use-of-vlas-in-c/73109 and our decision to move forward with that is independent of what GCC does. 

I saw that discussion, but I do miss where it has been agreed to diverge from GCC on this. Maybe more generic question will clear my misunderstanding: what is a stance of Clang on`-std=gnu++*`? Can it be different to what GCC does?

> Without more justification for walking this back, I do not agree with moving forward with the revert.

We have library code that has to use VLA in source code in certain scenario and rely on compiler to optimize it away. The library is built with `-Wall` and after it started to use newer Clang, the error appear.
The main concern is simple: GCC doesn't do that (yet). Understandably, if GCC agrees to diagnose it, that change will need to be reverted.

https://github.com/llvm/llvm-project/pull/89943


More information about the cfe-commits mailing list