<div dir="ltr">Hi guys,<div>Some thoughts that started in <a href="http://reviews.llvm.org/D18919">http://reviews.llvm.org/D18919</a>:</div><div>Is there any policy about requirements for modernize checks?</div><div><br></div><div>"<span style="color:rgb(70,76,92);font-family:'Segoe UI','Segoe UI Web Regular','Segoe UI Symbol','Helvetica Neue',Helvetica,Arial,sans-serif;font-size:13px;line-height:18.85px"> I see that some checks from modernize require C++11 (e.g. modernize-make-unique which is in C++14) and other require just C++ (modernize-loop-convert), and it even has a comment</span></div><p style="margin:0px 0px 12px;padding:0px;border:0px;color:rgb(70,76,92);font-family:'Segoe UI','Segoe UI Web Regular','Segoe UI Symbol','Helvetica Neue',Helvetica,Arial,sans-serif;font-size:13px;line-height:18.85px">// Only register the matchers for C++. Because this checker is used for</p><div class="" style="margin:12px 0px;padding:0px;border:0px;white-space:pre;color:rgb(70,76,92);font-family:'Segoe UI','Segoe UI Web Regular','Segoe UI Symbol','Helvetica Neue',Helvetica,Arial,sans-serif;font-size:13px;line-height:18.85px"><pre class="" style="margin-top:0px;margin-bottom:0px;padding:8px;border:1px solid rgb(233,219,205);color:rgb(0,0,0);overflow:auto;font-family:Menlo,Consolas,Monaco,monospace;font-stretch:normal;font-size:10px;line-height:normal;background:rgb(253,243,218)">// modernization, it is reasonable to run it on any C++ standard with the
// assumption the user is trying to modernize their codebase.
if (!getLangOpts().CPlusPlus)
return;</pre></div><p style="margin:0px 0px 12px;padding:0px;border:0px;color:rgb(70,76,92);font-family:'Segoe UI','Segoe UI Web Regular','Segoe UI Symbol','Helvetica Neue',Helvetica,Arial,sans-serif;font-size:13px;line-height:18.85px">I have 2 thoughts for this:</p><ol class="" style="margin:12px 0px 12px 30px;padding:0px;border:0px;color:rgb(70,76,92);font-family:'Segoe UI','Segoe UI Web Regular','Segoe UI Symbol','Helvetica Neue',Helvetica,Arial,sans-serif;font-size:13px;line-height:18.85px"><li class="" style="margin:0px;padding:0px;border:0px">there should be note in documentation about it, so the user won't spend time debuging why the check doesn't do anything. e.g. "This check requires to compile code with C++11 or higher"</li><li class="" style="margin:0px;padding:0px;border:0px">I would suggest modernize checks to require standard version the same or higher for C++ standars(featchures) that doesn't break backwards compatibility:</li></ol><p style="margin:0px;padding:0px;border:0px;color:rgb(70,76,92);font-family:'Segoe UI','Segoe UI Web Regular','Segoe UI Symbol','Helvetica Neue',Helvetica,Arial,sans-serif;font-size:13px;line-height:18.85px">e.g. loop-convert should require C++11, make-shared C++14, modernize-use-using also C++11 (because user can just start using C++11 or C++14 without any problems) <br>but for modernize-increment-bool, that is deprecated in C++17, it should require just C++ (because if someone need it, the he won't be able to compile his code with C++17)."</p><p style="margin:0px;padding:0px;border:0px;color:rgb(70,76,92);font-family:'Segoe UI','Segoe UI Web Regular','Segoe UI Symbol','Helvetica Neue',Helvetica,Arial,sans-serif;font-size:13px;line-height:18.85px"><br></p><p style="margin:0px;padding:0px;border:0px;color:rgb(70,76,92);font-family:'Segoe UI','Segoe UI Web Regular','Segoe UI Symbol','Helvetica Neue',Helvetica,Arial,sans-serif;line-height:18.85px">Do you think this idea is good? </p><p style="margin:0px;padding:0px;border:0px;color:rgb(70,76,92);font-family:'Segoe UI','Segoe UI Web Regular','Segoe UI Symbol','Helvetica Neue',Helvetica,Arial,sans-serif;line-height:18.85px"><br></p><p style="margin:0px;padding:0px;border:0px;color:rgb(70,76,92);font-family:'Segoe UI','Segoe UI Web Regular','Segoe UI Symbol','Helvetica Neue',Helvetica,Arial,sans-serif;line-height:18.85px">Piotr</p></div>