<div dir="ltr">That's a good point, but I don't think they're a big issue: this code has apparently been this way since 2010, and I only hit this problem because I was blindly adding `const` to things and looking for what broke. :)<div><br></div><div>If someone feels differently, I'm happy to swap this to use SFINAE magic.</div><div class="gmail_extra"><br><div class="gmail_quote">On Mon, Jan 9, 2017 at 8:34 AM, David Blaikie <span dir="ltr"><<a href="mailto:dblaikie@gmail.com" target="_blank">dblaikie@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr">Alternatively could make the bool ctor a template with some SFINAE to restrict it to only parameters of type bool - thus blocking all conversions there, if they're particularly problematic.</div><div class="m_-4657934607378880049HOEnZb"><div class="m_-4657934607378880049h5"><br><div class="gmail_quote"><div dir="ltr">On Wed, Jan 4, 2017 at 5:32 PM George Burgess IV via cfe-commits <<a href="mailto:cfe-commits@lists.llvm.org" target="_blank">cfe-commits@lists.llvm.org</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Author: gbiv<br class="m_-4657934607378880049m_5727309966262449423gmail_msg">
Date: Wed Jan  4 19:21:21 2017<br class="m_-4657934607378880049m_5727309966262449423gmail_msg">
New Revision: 291058<br class="m_-4657934607378880049m_5727309966262449423gmail_msg">
<br class="m_-4657934607378880049m_5727309966262449423gmail_msg">
URL: <a href="http://llvm.org/viewvc/llvm-project?rev=291058&view=rev" rel="noreferrer" class="m_-4657934607378880049m_5727309966262449423gmail_msg" target="_blank">http://llvm.org/viewvc/llvm-pr<wbr>oject?rev=291058&view=rev</a><br class="m_-4657934607378880049m_5727309966262449423gmail_msg">
Log:<br class="m_-4657934607378880049m_5727309966262449423gmail_msg">
[Sema] Mark undefined ctors as deleted. NFC.<br class="m_-4657934607378880049m_5727309966262449423gmail_msg">
<br class="m_-4657934607378880049m_5727309966262449423gmail_msg">
Looks like these functions exist just to prevent bad implicit<br class="m_-4657934607378880049m_5727309966262449423gmail_msg">
conversions. Rather than waiting for the linker to complain about<br class="m_-4657934607378880049m_5727309966262449423gmail_msg">
undefined references to them, we can mark them as deleted.<br class="m_-4657934607378880049m_5727309966262449423gmail_msg">
<br class="m_-4657934607378880049m_5727309966262449423gmail_msg">
Modified:<br class="m_-4657934607378880049m_5727309966262449423gmail_msg">
    cfe/trunk/include/clang/Sema/O<wbr>wnership.h<br class="m_-4657934607378880049m_5727309966262449423gmail_msg">
<br class="m_-4657934607378880049m_5727309966262449423gmail_msg">
Modified: cfe/trunk/include/clang/Sema/O<wbr>wnership.h<br class="m_-4657934607378880049m_5727309966262449423gmail_msg">
URL: <a href="http://llvm.org/viewvc/llvm-project/cfe/trunk/include/clang/Sema/Ownership.h?rev=291058&r1=291057&r2=291058&view=diff" rel="noreferrer" class="m_-4657934607378880049m_5727309966262449423gmail_msg" target="_blank">http://llvm.org/viewvc/llvm-pr<wbr>oject/cfe/trunk/include/clang/<wbr>Sema/Ownership.h?rev=291058&<wbr>r1=291057&r2=291058&view=diff</a><br class="m_-4657934607378880049m_5727309966262449423gmail_msg">
==============================<wbr>==============================<wbr>==================<br class="m_-4657934607378880049m_5727309966262449423gmail_msg">
--- cfe/trunk/include/clang/Sema/O<wbr>wnership.h (original)<br class="m_-4657934607378880049m_5727309966262449423gmail_msg">
+++ cfe/trunk/include/clang/Sema/O<wbr>wnership.h Wed Jan  4 19:21:21 2017<br class="m_-4657934607378880049m_5727309966262449423gmail_msg">
@@ -153,8 +153,8 @@ namespace clang {<br class="m_-4657934607378880049m_5727309966262449423gmail_msg">
     ActionResult(const DiagnosticBuilder &) : Val(PtrTy()), Invalid(true) {}<br class="m_-4657934607378880049m_5727309966262449423gmail_msg">
<br class="m_-4657934607378880049m_5727309966262449423gmail_msg">
     // These two overloads prevent void* -> bool conversions.<br class="m_-4657934607378880049m_5727309966262449423gmail_msg">
-    ActionResult(const void *);<br class="m_-4657934607378880049m_5727309966262449423gmail_msg">
-    ActionResult(volatile void *);<br class="m_-4657934607378880049m_5727309966262449423gmail_msg">
+    ActionResult(const void *) = delete;<br class="m_-4657934607378880049m_5727309966262449423gmail_msg">
+    ActionResult(volatile void *) = delete;<br class="m_-4657934607378880049m_5727309966262449423gmail_msg">
<br class="m_-4657934607378880049m_5727309966262449423gmail_msg">
     bool isInvalid() const { return Invalid; }<br class="m_-4657934607378880049m_5727309966262449423gmail_msg">
     bool isUsable() const { return !Invalid && Val; }<br class="m_-4657934607378880049m_5727309966262449423gmail_msg">
@@ -192,8 +192,8 @@ namespace clang {<br class="m_-4657934607378880049m_5727309966262449423gmail_msg">
     ActionResult(const DiagnosticBuilder &) : PtrWithInvalid(0x01) { }<br class="m_-4657934607378880049m_5727309966262449423gmail_msg">
<br class="m_-4657934607378880049m_5727309966262449423gmail_msg">
     // These two overloads prevent void* -> bool conversions.<br class="m_-4657934607378880049m_5727309966262449423gmail_msg">
-    ActionResult(const void *);<br class="m_-4657934607378880049m_5727309966262449423gmail_msg">
-    ActionResult(volatile void *);<br class="m_-4657934607378880049m_5727309966262449423gmail_msg">
+    ActionResult(const void *) = delete;<br class="m_-4657934607378880049m_5727309966262449423gmail_msg">
+    ActionResult(volatile void *) = delete;<br class="m_-4657934607378880049m_5727309966262449423gmail_msg">
<br class="m_-4657934607378880049m_5727309966262449423gmail_msg">
     bool isInvalid() const { return PtrWithInvalid & 0x01; }<br class="m_-4657934607378880049m_5727309966262449423gmail_msg">
     bool isUsable() const { return PtrWithInvalid > 0x01; }<br class="m_-4657934607378880049m_5727309966262449423gmail_msg">
<br class="m_-4657934607378880049m_5727309966262449423gmail_msg">
<br class="m_-4657934607378880049m_5727309966262449423gmail_msg">
______________________________<wbr>_________________<br class="m_-4657934607378880049m_5727309966262449423gmail_msg">
cfe-commits mailing list<br class="m_-4657934607378880049m_5727309966262449423gmail_msg">
<a href="mailto:cfe-commits@lists.llvm.org" class="m_-4657934607378880049m_5727309966262449423gmail_msg" target="_blank">cfe-commits@lists.llvm.org</a><br class="m_-4657934607378880049m_5727309966262449423gmail_msg">
<a href="http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits" rel="noreferrer" class="m_-4657934607378880049m_5727309966262449423gmail_msg" target="_blank">http://lists.llvm.org/cgi-bin/<wbr>mailman/listinfo/cfe-commits</a><br class="m_-4657934607378880049m_5727309966262449423gmail_msg">
</blockquote></div>
</div></div></blockquote></div><br></div></div>