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

Tareq A. Siraj tareq.a.siraj at intel.com
Wed Jan 16 12:20:08 PST 2013



================
Comment at: cpp11-migrate/UseNullptr/NullptrActions.cpp:33-35
@@ +32,5 @@
+/// (i.e. it has no explicit casts as an ancestor) where an implicit cast is
+/// nested within. However, there is no guarantee that only explicit casts
+/// exist between the found top-most explicit cast and the possibly more than
+/// one nested implicit cast. This visitor finds all cast sequences with an
+/// implicit cast to null within and creates a replacement.
----------------
Dmitri Gribenko wrote:
> Please add negative tests for these cases.
This should be covered by the test in basic.cpp:78-79. Did you have anything else in mind? Thanks.

`m_p = static_cast<T*>(p ? p : static_cast<void*>(g_null));`
`// CHECK: m_p = static_cast<T*>(p ? p : nullptr);`

I've addressed the other comments and will wait till this one is resolved before uploading the new patch.


http://llvm-reviews.chandlerc.com/D295



More information about the cfe-commits mailing list