[clang] Diagnose potential size confusion with VLA params [contd.] (PR #181550)

Yeoul Na via cfe-commits cfe-commits at lists.llvm.org
Mon Feb 16 13:52:45 PST 2026


================
@@ -10566,6 +10637,10 @@ Sema::ActOnFunctionDeclarator(Scope *S, Declarator &D, DeclContext *DC,
       }
     }
 
+    if (getLangOpts().BoundsSafety) {
----------------
rapidsna wrote:

Instead of guarding in under bounds-safety, we should guard it under whether `VLA` is supported.

There is a logic in `SemaType.cpp:BuildArrayType` whether `VLAIsError` is true of false. Should we make it a helper function and use that here? Or maybe @AaronBallman @cor3ntin has a better idea?

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


More information about the cfe-commits mailing list