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

Vane, Edwin edwin.vane at intel.com
Tue Jan 15 06:17:08 PST 2013


I tend to agree with Stefanus. If we were to make the use of nullptr a fixit only it would mean a two-step process for anybody migrating their code base with the cpp11-migrate tool: use cpp11-migrate to get everything but nullptr and then use clang in fixit mode to get nullptr. A fixit is definitely useful but having the same functionality in cpp11-migrate is also useful.

From: cfe-commits-bounces at cs.uiuc.edu [mailto:cfe-commits-bounces at cs.uiuc.edu] On Behalf Of Stefanus Du Toit
Sent: Monday, January 14, 2013 3:11 PM
To: David Blaikie
Cc: reviews+D295+public+6744ee1860a6976b at llvm-reviews.chandlerc.com; llvm cfe; Siraj, Tareq A
Subject: Re: [cfe-commits] [PATCH] Added use-nullptr transform into cpp11-migrate tool

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/20130115/dc5a6ffe/attachment.html>


More information about the cfe-commits mailing list