[cfe-commits] [PATCH] Added use-nullptr transform into cpp11-migrate tool

Stefanus Du Toit sjdutoit at gmail.com
Mon Jan 14 12:11:03 PST 2013


On Monday, January 14, 2013, David Blaikie wrote:

> On Mon, Jan 14, 2013 at 8:50 AM, Tareq A. Siraj <tareq.a.siraj at intel.com<javascript:;>>
> wrote:
> > This transform converts the usage of null pointer constants (e.g. NULL,
> 0,
> > etc.) in legacy C++ code and converts them to use the new C++11 nullptr
> > keyword.
>
> There are probably good reasons not to do this, but I'm still curious:
>
> Why not just build this in as a warning in clang with a FixIt? (&, if
> necessary, have a Clang Tool designed for applying a particular fixit
> to a codebase) GCC 4.8 already intends to have a
> -Wzero-as-null-pointer warning which we could match.


I think it makes sense to do this in both places. Having it in the rewriter
tool is sensible so it can be applied along with other C++11
transformations. The warning/fixit also makes sense. The core of this can
probably be reused and live in Clang eventually, but start off in the tool.

Stefanus
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20130114/6dcc18eb/attachment.html>


More information about the cfe-commits mailing list