[llvm-commits] [llvm] r163840 - /llvm/trunk/include/llvm/Support/type_traits.h

Richard Smith richard-llvm at metafoo.co.uk
Thu Sep 13 14:18:18 PDT 2012


Author: rsmith
Date: Thu Sep 13 16:18:18 2012
New Revision: 163840

URL: http://llvm.org/viewvc/llvm-project?rev=163840&view=rev
Log:
Fix some code which is invalid in C++11: an expression of enumeration type
can't be used as a non-type template argument of type bool.

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

Modified: llvm/trunk/include/llvm/Support/type_traits.h
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/Support/type_traits.h?rev=163840&r1=163839&r2=163840&view=diff
==============================================================================
--- llvm/trunk/include/llvm/Support/type_traits.h (original)
+++ llvm/trunk/include/llvm/Support/type_traits.h Thu Sep 13 16:18:18 2012
@@ -54,8 +54,9 @@
   // is_class<> metafunction due to Paul Mensonides (leavings at attbi.com). For
   // more details:
   // http://groups.google.com/groups?hl=en&selm=000001c1cc83%24e154d5e0%247772e50c%40c161550a&rnum=1
- public:
-    enum { value = sizeof(char) == sizeof(dont_use::is_class_helper<T>(0)) };
+public:
+  static const bool value =
+      sizeof(char) == sizeof(dont_use::is_class_helper<T>(0));
 };
   
   
@@ -162,12 +163,11 @@
   static UnderlyingT &nonce_instance;
 
 public:
-  enum {
+  static const bool
     value = (!is_class<UnderlyingT>::value && !is_pointer<UnderlyingT>::value &&
              !is_same<UnderlyingT, float>::value &&
              !is_same<UnderlyingT, double>::value &&
-             sizeof(char) != sizeof(check_int_convertible(nonce_instance)))
-  };
+             sizeof(char) != sizeof(check_int_convertible(nonce_instance)));
 };
 
 // enable_if_c - Enable/disable a template based on a metafunction





More information about the llvm-commits mailing list