[clang] [Clang] Fix null-pointer assertion reading CtorClosureDefaultArgs (PR #207917)

Wenju He via cfe-commits cfe-commits at lists.llvm.org
Tue Jul 7 02:58:38 PDT 2026


================
@@ -0,0 +1,33 @@
+// Test that MS ABI copy-constructor closures (built when throwing a class by
+// value whose copy constructor has default arguments) survive a PCH
+// round-trip. BuildCtorClosureDefaultArgs deliberately leaves the first
+// default-arg slot null for a copy ctor closure (the closure itself supplies
+// that argument).
+//
+// Test this without pch.
+// RUN: %clang_cc1 -fcxx-exceptions -fms-extensions -triple i386-pc-win32 -std=c++20 -include %s -emit-llvm -o - %s | FileCheck --check-prefixes=CHECK,CHECK-NOPCH %s
+//
+// Test with pch.
+// #207949: this cannot check for ??_ODefault copy-ctor closure:
+// ASTContext::CopyConstructorForExceptionObject is serialized into the PCH.
----------------
wenju-he wrote:

done

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


More information about the cfe-commits mailing list