[clang] [clang][CodeGen] Fix crash for VLA alias in local class constructor (PR #183933)
via cfe-commits
cfe-commits at lists.llvm.org
Mon Mar 9 10:33:57 PDT 2026
================
@@ -0,0 +1,15 @@
+// RUN: %clang_cc1 -std=gnu++20 -emit-llvm %s -o - >/dev/null
+
+int f() { return 1; }
+
+int test0() {
+ using X = int[f()];
+
+ struct S {
+ S() {
+ X x;
----------------
AV01DANC3 wrote:
Good catch! I agree with your example and I'll take a look at Sema shortly.
> we can't correctly compute the size of a variably modified type from within a local class
Just to make sure I understand correctly: should we reject this even for simpler cases like my original example, where the type is only used to declare a local variable inside the constructor?
https://github.com/llvm/llvm-project/pull/183933
More information about the cfe-commits
mailing list