[clang] [Clang] Fix crashes in coroutine pack expansions (PR #237969)

Kunal Dubey via cfe-commits cfe-commits at lists.llvm.org
Tue Nov 3 01:54:54 PST 2026


================
@@ -27,8 +27,10 @@ ExprDependence clang::computeDependence(FullExpr *E) {
 
 ExprDependence clang::computeDependence(OpaqueValueExpr *E) {
   auto D = toExprDependenceForImpliedType(E->getType()->getDependence());
+  // An OpaqueValueExpr has no syntactic children, so it does not contain an
+  // unexpanded pack even if its source does.
   if (auto *S = E->getSourceExpr())
-    D |= S->getDependence();
+    D |= S->getDependence() & ~ExprDependence::UnexpandedPack;
   assert(!(D & ExprDependence::UnexpandedPack));
----------------
xakep8 wrote:

Yes that makes sense but there is TransformBinaryConditionalOperator which transforms the common expression which OVE refers to like `values` in the case I mentioned, and then it will transform the false expression and then rebuild the `values ?: 0` expression and then the rebuild will also create a new OVE from the transformed pack.

But while we're talking about this there is one risk to what I did, if the source expression information is not retained for some case then this could cause an issue but what I'm thinking is if that would even be the case ever? also if some other case does not have a custom rebuild path for transformed situation then that could be another issue......

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


More information about the cfe-commits mailing list