[clang] [Clang] Fix crash with large pack indexing indices (PR #247923)

via cfe-commits cfe-commits at lists.llvm.org
Wed Dec 2 03:07:13 PST 2026


================
@@ -4533,15 +4533,15 @@ PackIndexingType::PackIndexingType(QualType Canonical, QualType Pattern,
 }
 
 UnsignedOrNone PackIndexingType::getSelectedIndex() const {
-  if (isInstantiationDependentType())
+  if (!isFullySubstituted() || isInstantiationDependentType())
----------------
YzK0741 wrote:

Good question. The intent was to avoid returning a selected index before Sema had checked it against the pack size. I removed the check and reran cxx2c-pack-indexing.cpp, including the new regression tests. They still pass, so I’ve dropped the check from this PR.

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


More information about the cfe-commits mailing list