[cfe-dev] Help reg. clang

Kim Gräsman via cfe-dev cfe-dev at lists.llvm.org
Fri Apr 1 05:50:45 PDT 2016


There's also a pretty ambitious clang-tidy check for exactly this:
http://clang.llvm.org/extra/clang-tidy/checks/misc-suspicious-semicolon.html

It was added quite recently:
http://reviews.llvm.org/D16535

- Kim

On Fri, Apr 1, 2016 at 2:18 PM, Nemanja Ivanovic via cfe-dev
<cfe-dev at lists.llvm.org> wrote:
> There is already some handling for this type of thing. Perhaps this does not
> suffice for your purposes but it is likely worth a look.
> See warnings in Sema::ActOnIfStmt (that calls Sema::DiagnoseEmptyStmtBody)
> and Sema::DiagnoseEmptyLoopBody (in lib/Sema/SemaChecking.cpp and
> lib/Sema/SemaStmt.cpp respectively).
>
> Nemanja
>
> On Fri, Apr 1, 2016 at 12:43 PM, Swaresh Sankpal via cfe-dev
> <cfe-dev at lists.llvm.org> wrote:
>>
>> Hi,
>>
>> I am trying to produce warnings when semicolon is found after if,for,while
>> loops.How to achieve this solution using ast matcher?.Basically, have to
>> match null statement inside a loop(for,if,while).Any help is appreciated.
>>
>> Swaresh
>> IIT Bombay,India
>>
>> _______________________________________________
>> cfe-dev mailing list
>> cfe-dev at lists.llvm.org
>> http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-dev
>>
>
>
> _______________________________________________
> cfe-dev mailing list
> cfe-dev at lists.llvm.org
> http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-dev
>



More information about the cfe-dev mailing list