[cfe-commits] [PATCH][PR11329][v7] Generalize -Wempty-body: warn when statement body is empty

Dmitri Gribenko gribozavr at gmail.com
Wed Feb 1 09:44:44 PST 2012


On Tue, Jan 31, 2012 at 8:58 PM, Dmitri Gribenko <gribozavr at gmail.com> wrote:
> On Wed, Jan 25, 2012 at 10:25 PM, Dmitri Gribenko <gribozavr at gmail.com> wrote:
>> On Wed, Jan 25, 2012 at 9:56 PM, Argyrios Kyrtzidis <kyrtzidis at apple.com> wrote:
>>> I don't think it make sense to warn on template instantiations, since these are syntactic warnings. For template instantiations they would only contribute noise [...]
>>
>> Agreed, see attached patch.
>
> Ping.  Please review.
>
> Changes compared to v10:
> * check Sema::CurrentInstantiationScope to silence warnings for
> template instantiations (is this the correct approach?)
> * patch rebased to current trunk;
> * a new testcase was added in r149109 to
> test/SemaCXX/for-range-examples.cpp, silenced this new warning there.

Please excuse me for one more email, but another test with empty body
was just added to test/SemaCXX/for-range-examples.cpp, so it required
fixing from my side.

Dmitri

-- 
main(i,j){for(i=2;;i++){for(j=2;j<i;j++){if(!(i%j)){j=0;break;}}if
(j){printf("%d\n",i);}}} /*Dmitri Gribenko <gribozavr at gmail.com>*/
-------------- next part --------------
A non-text attachment was scrubbed...
Name: generalize-warn-empty-body-v13.patch
Type: text/x-diff
Size: 35125 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20120201/dc350bb0/attachment.patch>


More information about the cfe-commits mailing list