r291058 - [Sema] Mark undefined ctors as deleted. NFC.

George Burgess IV via cfe-commits cfe-commits at lists.llvm.org
Wed Jan 4 17:21:21 PST 2017


Author: gbiv
Date: Wed Jan  4 19:21:21 2017
New Revision: 291058

URL: http://llvm.org/viewvc/llvm-project?rev=291058&view=rev
Log:
[Sema] Mark undefined ctors as deleted. NFC.

Looks like these functions exist just to prevent bad implicit
conversions. Rather than waiting for the linker to complain about
undefined references to them, we can mark them as deleted.

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=291058&r1=291057&r2=291058&view=diff
==============================================================================
--- cfe/trunk/include/clang/Sema/Ownership.h (original)
+++ cfe/trunk/include/clang/Sema/Ownership.h Wed Jan  4 19:21:21 2017
@@ -153,8 +153,8 @@ namespace clang {
     ActionResult(const DiagnosticBuilder &) : Val(PtrTy()), Invalid(true) {}
 
     // These two overloads prevent void* -> bool conversions.
-    ActionResult(const void *);
-    ActionResult(volatile void *);
+    ActionResult(const void *) = delete;
+    ActionResult(volatile void *) = delete;
 
     bool isInvalid() const { return Invalid; }
     bool isUsable() const { return !Invalid && Val; }
@@ -192,8 +192,8 @@ namespace clang {
     ActionResult(const DiagnosticBuilder &) : PtrWithInvalid(0x01) { }
 
     // These two overloads prevent void* -> bool conversions.
-    ActionResult(const void *);
-    ActionResult(volatile void *);
+    ActionResult(const void *) = delete;
+    ActionResult(volatile void *) = delete;
 
     bool isInvalid() const { return PtrWithInvalid & 0x01; }
     bool isUsable() const { return PtrWithInvalid > 0x01; }




More information about the cfe-commits mailing list