llvm-project
8ba0041e - Stop double-diagnosing explicit convert operator in switch condition (#89142)

Commit
1 year ago
Stop double-diagnosing explicit convert operator in switch condition (#89142) Note this also likely fixes a bunch of other cases. We were double-diagnosting in a template because we were generating the expression anyway, so any attempts to instantiate the function would instantiate the expression, thus re-diagnosing it. This patch replaces it with a RecoveryExpr. Additionally, VerifyIntegerConstantExpression couldn't handle the RecoveryExpr, as it requires a non-dependent expression result (which a RecoveryExpr is dependent). Additionally, callers of it use the return value to decide that VerifyIntegerConstantExpression succeeded, so it fails if it sees a RecoveryExpr.
Author
Parents
Loading