bool foo(bool a) {
bool x;
if ((x = (a ? false : true))) // YOI
return !x;
if (bool y = (a ? true : false)) // DAME
return y;
return a;
}
(https://godbolt.org/z/Tch3cP4G8)
"YOI" is expected.
Branch,File 0, 3:9 -> 3:33 = #1, (#0 - #1)
Branch,File 0, 3:15 -> 3:16 = #2, (#0 - #2)
"DAME" doesn't emit CondOp but has only Branch for IfStmt.
Branch,File 0, 5:14 -> 5:15 = #3, ((#0 - #1) - #3)
Looks like CoverageMappingGen.cpp doesn't traverse VarDecl on Cond.