[llvm] r286083 - [RandomNumberGenerator] Remove MSVC 2013 compatibility hack.

Davide Italiano via llvm-commits llvm-commits at lists.llvm.org
Sun Nov 6 12:55:40 PST 2016


Author: davide
Date: Sun Nov  6 14:55:40 2016
New Revision: 286083

URL: http://llvm.org/viewvc/llvm-project?rev=286083&view=rev
Log:
[RandomNumberGenerator] Remove MSVC 2013 compatibility hack.

Modified:
    llvm/trunk/include/llvm/Support/RandomNumberGenerator.h

Modified: llvm/trunk/include/llvm/Support/RandomNumberGenerator.h
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/Support/RandomNumberGenerator.h?rev=286083&r1=286082&r2=286083&view=diff
==============================================================================
--- llvm/trunk/include/llvm/Support/RandomNumberGenerator.h (original)
+++ llvm/trunk/include/llvm/Support/RandomNumberGenerator.h Sun Nov  6 14:55:40 2016
@@ -44,18 +44,8 @@ public:
   /// Returns a random number in the range [0, Max).
   result_type operator()();
 
-  // We can only make min/max constexpr if generator_type::min/max are
-  // constexpr.  The MSVC 2013 STL does not make these constexpr, so we have to
-  // avoid declaring them as constexpr even if the compiler, like clang-cl,
-  // supports it.
-#if defined(_MSC_VER) && _MSC_VER < 1900
-#define STL_CONSTEXPR
-#else
-#define STL_CONSTEXPR constexpr
-#endif
-
-  static STL_CONSTEXPR result_type min() { return generator_type::min(); }
-  static STL_CONSTEXPR result_type max() { return generator_type::max(); }
+  static constexpr result_type min() { return generator_type::min(); }
+  static constexpr result_type max() { return generator_type::max(); }
 
 private:
   /// Seeds and salts the underlying RNG engine.




More information about the llvm-commits mailing list