[PATCH] Fixed UseNullptr causes compile error when replacing return(0);

Stefanus Du Toit stefanus.du.toit at intel.com
Tue Mar 5 12:05:29 PST 2013



================
Comment at: cpp11-migrate/UseNullptr/NullptrActions.cpp:113
@@ -112,3 +112,3 @@
   if (Cast) {
-    SourceLocation StartLoc = Cast->getLocStart();
-    SourceLocation EndLoc = Cast->getLocEnd();
+    const Expr *E = Cast->IgnoreParenImpCasts();
+
----------------
Does this need to happen for explicit casts as well?

================
Comment at: test/cpp11-migrate/UseNullptr/basic.cpp:222
@@ +221,2 @@
+  // CHECK: return((((nullptr))));
+}
----------------
As per above, add a test case like

return ((static_cast<void*>(0)));

or similar


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



More information about the cfe-commits mailing list