[clang] Stop double-diagnosing explicit convert operator in switch condition (PR #89142)

via cfe-commits cfe-commits at lists.llvm.org
Thu Apr 18 09:16:10 PDT 2024


Sirraide wrote:

> I've only ever seen that used in regards to the `RecoveryExpr`, so I think I am?

It’s used in a few other places from what I can tell (e.g. see `InitListExpr::markError()`); I think the result is the same either way (i.e. `containsErrors()` ends up returning `true`). 

I was looking around a bit and also just found this comment here:
https://github.com/llvm/llvm-project/blob/215eee60497489ae0cc7cc78c0d8b8270e057a70/clang/lib/Sema/SemaExpr.cpp#L3734-L3739
So I suppose there is at least some prededent for using `RecoveryExpr` for this. 

I don’t have too much experience with either, but at least intuitively, `ExprDependence::Error` sounds like it would make sense here, because if not for cases like this one then what is it actually for I wonder?

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


More information about the cfe-commits mailing list