<div dir="ltr"><br><div class="gmail_extra"><br><div class="gmail_quote">On Fri, Feb 20, 2015 at 9:10 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:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="ltr"><br><div class="gmail_extra"><br><div class="gmail_quote"><span>On Fri, Feb 20, 2015 at 5:16 AM, Benjamin Kramer <span dir="ltr"><<a href="mailto:benny.kra@googlemail.com" target="_blank">benny.kra@googlemail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">Author: d0k<br>
Date: Fri Feb 20 07:16:05 2015<br>
New Revision: 230010<br>
<br>
URL: <a href="http://llvm.org/viewvc/llvm-project?rev=230010&view=rev" target="_blank">http://llvm.org/viewvc/llvm-project?rev=230010&view=rev</a><br>
Log:<br>
Make the static instance of None just const.<br>
<br>
This way there shouldn't be any unused variable warnings.<br>
<br>
Modified:<br>
llvm/trunk/include/llvm/ADT/None.h<br>
<br>
Modified: llvm/trunk/include/llvm/ADT/None.h<br>
URL: <a href="http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/ADT/None.h?rev=230010&r1=230009&r2=230010&view=diff" target="_blank">http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/ADT/None.h?rev=230010&r1=230009&r2=230010&view=diff</a><br>
==============================================================================<br>
--- llvm/trunk/include/llvm/ADT/None.h (original)<br>
+++ llvm/trunk/include/llvm/ADT/None.h Fri Feb 20 07:16:05 2015<br>
@@ -20,7 +20,7 @@ namespace llvm {<br>
/// \brief A simple null object to allow implicit construction of Optional<T><br>
/// and similar types without having to spell out the specialization's name.<br>
enum class NoneType { None };<br></blockquote></span><div><br>At this point NoneType could just be an opaque/trivial struct instead of an enum class?<br></div></div></div></div></blockquote><div><br></div><div>I seem to recall a discussion where an empty init list was suggested as a replacement for None?<br><br></div><div>... digging ...<br><br>Not really. I guess what John suggested here was sort of array-specific: "[PATCH] Use ArrayRef in SemaInit.cpp." (<a href="http://thread.gmane.org/gmane.comp.compilers.clang.scm/72201">http://thread.gmane.org/gmane.comp.compilers.clang.scm/72201</a>)<br></div><div><br></div><div>-- Sean Silva<br></div><div> </div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="ltr"><div class="gmail_extra"><div class="gmail_quote"><div> </div><span><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
-static NoneType None;<br>
+const NoneType None = None;<br></blockquote></span><div><br>Does this result in ODR violations? (either because None is not defined in the program at all and it is ODR used, or because this is a definition (?) and it's in multiple translation units? - I always forget which)<br> </div><span><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
}<br>
<br>
#endif<br>
<br>
<br>
_______________________________________________<br>
llvm-commits mailing list<br>
<a href="mailto:llvm-commits@cs.uiuc.edu" target="_blank">llvm-commits@cs.uiuc.edu</a><br>
<a href="http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits" target="_blank">http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits</a><br>
</blockquote></span></div><br></div></div>
<br>_______________________________________________<br>
llvm-commits mailing list<br>
<a href="mailto:llvm-commits@cs.uiuc.edu" target="_blank">llvm-commits@cs.uiuc.edu</a><br>
<a href="http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits" target="_blank">http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits</a><br>
<br></blockquote></div><br></div></div>