[clang] Increase the limit for ctor initializers (PR #239011)

Oliver Hunt via cfe-commits cfe-commits at lists.llvm.org
Thu Nov 5 22:56:33 PST 2026


================
@@ -1855,12 +1846,12 @@ class DeclContext {
     LLVM_PREFERRED_TYPE(FunctionDeclBitfields)
     uint64_t : NumFunctionDeclBits;
 
-    /// 19 bits to fit in the remaining available space.
-    /// Note that this makes CXXConstructorDeclBitfields take
-    /// exactly 64 bits and thus the width of NumCtorInitializers
-    /// will need to be shrunk if some bit is added to NumDeclContextBitfields,
-    /// NumFunctionDeclBitfields or CXXConstructorDeclBitfields.
----------------
ojhunt wrote:

it seems like 500k could come fairly easily via `#embed`? it's terrible but not impossible, and you could imagine someone hitting it plausibly? or maybe not - I was thinking T foo[] = {...embed...} with std::array<T> but that still takes an initializer list not 500k arguments)


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


More information about the cfe-commits mailing list