[clang] [Clang] Handle ?: operator in fold expression (PR #164019)
Azmat Yusuf via cfe-commits
cfe-commits at lists.llvm.org
Sun Nov 30 05:57:21 PST 2025
azmat-y wrote:
> I’m not convinced this is the right approach; what if we have e.g.
>
> ```c++
> template <typename ... T>
> void foo(T... Params) {
> ([&]{ Params ?: 1; }(), ...);
> }
> ```
>
> We still crash on this and I’m sure `commonExpr` would still be pack-dependent in this case, but we don’t want this to become invalid.
>
> I wonder if we should just delete the assertion in `computeDependence(OpaqueValueExpr*)`.
Sorry for late response. Yeah that should stay valid `commonExpr` does remain pack dependent , though something weird is happening with my build. It compiles your example without any errors even though `commonExpr` is pack dependent, the control flow moves to ExprError() but after continuing with the execution no error is raised.
Could something else suppress `ExprError()`?
https://github.com/llvm/llvm-project/pull/164019
More information about the cfe-commits
mailing list