From: George Burgess IV Date: Thu, 5 Jan 2017 01:21:21 +0000 (+0000) Subject: [Sema] Mark undefined ctors as deleted. NFC. X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=a82cebf937657a66d2c2dd474a249c84541afdcf;p=clang [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. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@291058 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/include/clang/Sema/Ownership.h b/include/clang/Sema/Ownership.h index 92ea5296c4..fd46de870f 100644 --- a/include/clang/Sema/Ownership.h +++ b/include/clang/Sema/Ownership.h @@ -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; }