[clang] [clang] Fix high memory consumption during pack deduction (PR #88637)

Thorsten Schütt via cfe-commits cfe-commits at lists.llvm.org
Sun Apr 14 06:04:42 PDT 2024


================
@@ -831,7 +831,7 @@ class PackDeductionScope {
     if (IsPartiallyExpanded)
       PackElements += NumPartialPackArgs;
     else if (IsExpanded)
-      PackElements += *FixedNumExpansions;
+      PackElements += FixedNumExpansions.value_or(1);
----------------
tschuett wrote:

Could you add an assert:
```
assert(FixedNumExpansions && "unexpected nullopt");
```

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


More information about the cfe-commits mailing list