[clang] [CIR] SubscriptExpr for VariableLengthArray (PR #175370)

Amr Hesham via cfe-commits cfe-commits at lists.llvm.org
Tue Jan 13 09:19:21 PST 2026


================
@@ -339,3 +339,57 @@ int f5(unsigned long len) {
 // OGCG:   %[[STACK_RESTORE_PTR:.*]] = load ptr, ptr %[[SAVED_STACK]]
 // OGCG:   call void @llvm.stackrestore.p0(ptr %[[STACK_RESTORE_PTR]])
 // OGCG:   ret i32 %[[ARR_VAL]]
+
+void vla_subscript_expr() {
+  int **a;
+  unsigned long n = 5;
+  (int (**)[n]){&a}[0][1][5] = 0;
----------------
AmrDeveloper wrote:

I will update the PR description also. Sorry for the confusion 

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


More information about the cfe-commits mailing list