[llvm] r292155 - Attempt to workaround MSVC build issue where I suspect an enum class constant 0 is considered a possible null pointer

David Blaikie via llvm-commits llvm-commits at lists.llvm.org
Mon Jan 16 12:29:00 PST 2017


Author: dblaikie
Date: Mon Jan 16 14:28:59 2017
New Revision: 292155

URL: http://llvm.org/viewvc/llvm-project?rev=292155&view=rev
Log:
Attempt to workaround MSVC build issue where I suspect an enum class constant 0 is considered a possible null pointer

I can't reproduce this so far with web compilers, so throwing this at
the bots to see if it sticks.

Modified:
    llvm/trunk/include/llvm/ADT/None.h

Modified: llvm/trunk/include/llvm/ADT/None.h
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/ADT/None.h?rev=292155&r1=292154&r2=292155&view=diff
==============================================================================
--- llvm/trunk/include/llvm/ADT/None.h (original)
+++ llvm/trunk/include/llvm/ADT/None.h Mon Jan 16 14:28:59 2017
@@ -19,7 +19,8 @@
 namespace llvm {
 /// \brief A simple null object to allow implicit construction of Optional<T>
 /// and similar types without having to spell out the specialization's name.
-enum class NoneType { None };
+// (constant value 1 in an attempt to workaround MSVC build issue... )
+enum class NoneType { None = 1 };
 const NoneType None = NoneType::None;
 }
 




More information about the llvm-commits mailing list