[PATCH] Replace OwningPtr::isValid() with conversion to bool.

David Blaikie dblaikie at gmail.com
Fri Mar 7 08:14:45 PST 2014



================
Comment at: include/clang/Frontend/ASTUnit.h:503
@@ -502,3 +502,3 @@
 
-  bool hasSema() const { return TheSema.isValid(); }
+  bool hasSema() const { return bool(TheSema); }
   Sema &getSema() const { 
----------------
I /think/ we favor C++ style casts even in this context (static_cast<bool>(TheSema)), but if not, I'd at least prefer (bool)TheSema over function-style cast (though perhaps there's not precedent there either)


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



More information about the cfe-commits mailing list