[clang] [clang] Diagnose VLA types from an enclosing function in local classes and blocks (PR #229697)

Eli Friedman via cfe-commits cfe-commits at lists.llvm.org
Sat Oct 17 16:04:50 PDT 2026


================
@@ -2370,6 +2370,14 @@ QualType Sema::BuildArrayType(QualType T, ArraySizeModifier ASM,
     }
   }
 
+  // Remember where the bound of a VLA is evaluated. Bounds in a function
+  // prototype are evaluated in that function, which doesn't exist yet;
+  // those are not recorded and never diagnosed.
----------------
efriedma-quic wrote:

This seems like something we should address somehow.  Or at least have some kind of test coverage demonstrating the gaps.

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


More information about the cfe-commits mailing list