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

Dmitri Gribenko gribozavr at gmail.com
Tue Jan 31 10:58:33 PST 2012


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.

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-v12.patch
Type: text/x-diff
Size: 34617 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20120131/f53d6b5d/attachment.patch>


More information about the cfe-commits mailing list