r257955 - OpaquePtr: Provide conversion-from-nullptr_t to make default construction simpler to read/write

David Blaikie via cfe-commits cfe-commits at lists.llvm.org
Fri Jan 15 15:43:22 PST 2016


Author: dblaikie
Date: Fri Jan 15 17:43:21 2016
New Revision: 257955

URL: http://llvm.org/viewvc/llvm-project?rev=257955&view=rev
Log:
OpaquePtr: Provide conversion-from-nullptr_t to make default construction simpler to read/write

Modified:
    cfe/trunk/include/clang/Sema/Ownership.h

Modified: cfe/trunk/include/clang/Sema/Ownership.h
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/include/clang/Sema/Ownership.h?rev=257955&r1=257954&r2=257955&view=diff
==============================================================================
--- cfe/trunk/include/clang/Sema/Ownership.h (original)
+++ cfe/trunk/include/clang/Sema/Ownership.h Fri Jan 15 17:43:21 2016
@@ -43,13 +43,13 @@ namespace clang {
   /// compatible with "Type" pointers for example.
   template <class PtrTy>
   class OpaquePtr {
-    void *Ptr;
+    void *Ptr = nullptr;
     explicit OpaquePtr(void *Ptr) : Ptr(Ptr) {}
 
     typedef llvm::PointerLikeTypeTraits<PtrTy> Traits;
 
   public:
-    OpaquePtr() : Ptr(nullptr) {}
+    OpaquePtr(std::nullptr_t = nullptr) {}
 
     static OpaquePtr make(PtrTy P) { OpaquePtr OP; OP.set(P); return OP; }
 




More information about the cfe-commits mailing list