[PATCH] D156565: Diagnose use of VLAs in C++ by default

Timm Bäder via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Mon Oct 2 07:30:04 PDT 2023


tbaeder added inline comments.


================
Comment at: clang/test/SemaCXX/offsetof.cpp:31
+  int array1[__builtin_offsetof(HasArray, array[i])]; // expected-warning {{variable length arrays are a Clang extension}} \
+                                                         new-interp-note {{function parameter 'i' with unknown value cannot be used in a constant expression}}
 }
----------------
aaron.ballman wrote:
> jyknight wrote:
> > Weird that new-interp adds the diagnostic for C++98 mode. I wonder if that indicates a bug (e.g. if in new-interp we accidentally use C++11 rules for C++98)?
> CC @tbaeder 
https://github.com/llvm/llvm-project/pull/67990


CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D156565/new/

https://reviews.llvm.org/D156565



More information about the cfe-commits mailing list