From 0067567927b3dad6457158ebc51fedc7ed163cb6 Mon Sep 17 00:00:00 2001 From: Richard Smith Date: Thu, 13 Sep 2012 21:18:18 +0000 Subject: [PATCH] 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. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@163840 91177308-0d34-0410-b5e6-96231b3b80d8 --- include/llvm/Support/type_traits.h | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/include/llvm/Support/type_traits.h b/include/llvm/Support/type_traits.h index 7b97547be52..f9306395fce 100644 --- a/include/llvm/Support/type_traits.h +++ b/include/llvm/Support/type_traits.h @@ -54,8 +54,9 @@ struct is_class // is_class<> metafunction due to Paul Mensonides (leavings@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(0)) }; +public: + static const bool value = + sizeof(char) == sizeof(dont_use::is_class_helper(0)); }; @@ -162,12 +163,11 @@ template class is_integral_or_enum { static UnderlyingT &nonce_instance; public: - enum { + static const bool value = (!is_class::value && !is_pointer::value && !is_same::value && !is_same::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