<p dir="ltr"></p>
<p dir="ltr">On 1 Dec 2016 8:37 p.m., "Mads Ravn" <<a href="mailto:madsravn@gmail.com">madsravn@gmail.com</a>> wrote:<br>
> I see the idea for the fixit clearly for case 3 & 4. Just erase .compare(str2) and replace 0 with str2. I have a quick question though: Given the declRefExpr().bind("str2"), how do I read the name of it in clang-tidy? Or should I just bind 0 as well and then create replacement with str where const auto str = Result.Nodes.getNodeAs<Stmt>("str2") ?</p>
<p dir="ltr">You could use <br>
FixItHint::CreateInsertionFromRange to copy str2 to 0, or leave str2 where it is, remove the binary operator and create a new one between the strings.</p>
<p dir="ltr">> Where I seem to find a little trouble is how to fixit case 1 & 2 now that they are reduced to one case. How do I check whether or not there is a unary operator in front of the implicitCast?</p>
<p dir="ltr">No idea.<br>
</p>