[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
Tue Oct 13 15:53:40 PDT 2026


================
@@ -7017,6 +7017,15 @@ Sema::CheckTypedefForVariablyModifiedType(Scope *S, TypedefNameDecl *NewTD) {
   // that redeclarations will match.
   TypeSourceInfo *TInfo = NewTD->getTypeSourceInfo();
   QualType T = TInfo->getType();
+
+  // A member typedef cannot name a variably modified type whose bound is
+  // evaluated in an enclosing function.
+  if (NewTD->getDeclContext()->isRecord() &&
----------------
efriedma-quic wrote:

The isRecord() looks suspicious.

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


More information about the cfe-commits mailing list