diff --git a/docs/HowToSetUpLLVMStyleRTTI.rst b/docs/HowToSetUpLLVMStyleRTTI.rst index e0f865a141c..96275e7dc23 100644 --- a/docs/HowToSetUpLLVMStyleRTTI.rst +++ b/docs/HowToSetUpLLVMStyleRTTI.rst @@ -223,8 +223,8 @@ steps: [...] template static bool classof(const T *, - ::llvm::enable_if_c< - ::llvm::is_base_of::value + ::std::enable_if< + ::std::is_base_of::value >::type* = 0) { return true; } [...] }; diff --git a/include/llvm/ADT/DenseMap.h b/include/llvm/ADT/DenseMap.h index 07cfe406d6c..037989f49db 100644 --- a/include/llvm/ADT/DenseMap.h +++ b/include/llvm/ADT/DenseMap.h @@ -977,7 +977,8 @@ class DenseMapIterator { friend class DenseMapIterator; public: typedef ptrdiff_t difference_type; - typedef typename conditional::type value_type; + typedef typename std::conditional::type + value_type; typedef value_type *pointer; typedef value_type &reference; typedef std::forward_iterator_tag iterator_category; diff --git a/include/llvm/ADT/Hashing.h b/include/llvm/ADT/Hashing.h index e434417da7c..4bffd8e6e26 100644 --- a/include/llvm/ADT/Hashing.h +++ b/include/llvm/ADT/Hashing.h @@ -109,7 +109,8 @@ public: /// differing argument types even if they would implicit promote to a common /// type without changing the value. template -typename enable_if, hash_code>::type hash_value(T value); +typename std::enable_if::value, hash_code>::type +hash_value(T value); /// \brief Compute a hash_code for a pointer's address. /// @@ -352,24 +353,24 @@ inline size_t get_execution_seed() { // and pointers, but there are platforms where it doesn't and we would like to // support user-defined types which happen to satisfy this property. template struct is_hashable_data - : integral_constant::value || - is_pointer::value) && - 64 % sizeof(T) == 0)> {}; + : std::integral_constant::value || + std::is_pointer::value) && + 64 % sizeof(T) == 0)> {}; // Special case std::pair to detect when both types are viable and when there // is no alignment-derived padding in the pair. This is a bit of a lie because // std::pair isn't truly POD, but it's close enough in all reasonable // implementations for our use case of hashing the underlying data. template struct is_hashable_data > - : integral_constant::value && - is_hashable_data::value && - (sizeof(T) + sizeof(U)) == - sizeof(std::pair))> {}; + : std::integral_constant::value && + is_hashable_data::value && + (sizeof(T) + sizeof(U)) == + sizeof(std::pair))> {}; /// \brief Helper to get the hashable data representation for a type. /// This variant is enabled when the type itself can be used. template -typename enable_if, T>::type +typename std::enable_if::value, T>::type get_hashable_data(const T &value) { return value; } @@ -377,7 +378,7 @@ get_hashable_data(const T &value) { /// This variant is enabled when we must first call hash_value and use the /// result as our data. template -typename enable_if_c::value, size_t>::type +typename std::enable_if::value, size_t>::type get_hashable_data(const T &value) { using ::llvm::hash_value; return hash_value(value); @@ -451,7 +452,7 @@ hash_code hash_combine_range_impl(InputIteratorT first, InputIteratorT last) { /// are stored in contiguous memory, this routine avoids copying each value /// and directly reads from the underlying memory. template -typename enable_if, hash_code>::type +typename std::enable_if::value, hash_code>::type hash_combine_range_impl(ValueT *first, ValueT *last) { const size_t seed = get_execution_seed(); const char *s_begin = reinterpret_cast(first); @@ -734,7 +735,7 @@ inline hash_code hash_integer_value(uint64_t value) { // Declared and documented above, but defined here so that any of the hashing // infrastructure is available. template -typename enable_if, hash_code>::type +typename std::enable_if::value, hash_code>::type hash_value(T value) { return ::llvm::hashing::detail::hash_integer_value(value); } diff --git a/include/llvm/ADT/StringRef.h b/include/llvm/ADT/StringRef.h index bbfbf6744a3..0514d7b1964 100644 --- a/include/llvm/ADT/StringRef.h +++ b/include/llvm/ADT/StringRef.h @@ -11,7 +11,6 @@ #define LLVM_ADT_STRINGREF_H #include "llvm/Support/Allocator.h" -#include "llvm/Support/type_traits.h" #include #include #include @@ -341,7 +340,7 @@ namespace llvm { /// this returns true to signify the error. The string is considered /// erroneous if empty or if it overflows T. template - typename enable_if_c::is_signed, bool>::type + typename std::enable_if::is_signed, bool>::type getAsInteger(unsigned Radix, T &Result) const { long long LLVal; if (getAsSignedInteger(*this, Radix, LLVal) || @@ -352,7 +351,7 @@ namespace llvm { } template - typename enable_if_c::is_signed, bool>::type + typename std::enable_if::is_signed, bool>::type getAsInteger(unsigned Radix, T &Result) const { unsigned long long ULLVal; if (getAsUnsignedInteger(*this, Radix, ULLVal) || diff --git a/include/llvm/Analysis/RegionInfo.h b/include/llvm/Analysis/RegionInfo.h index c45a2063415..4d55408a477 100644 --- a/include/llvm/Analysis/RegionInfo.h +++ b/include/llvm/Analysis/RegionInfo.h @@ -496,13 +496,11 @@ public: //@{ template class block_iterator_wrapper - : public df_iterator::type*> { - typedef df_iterator::type*> - super; + : public df_iterator::type *> { + typedef df_iterator::type *> super; + public: typedef block_iterator_wrapper Self; typedef typename super::pointer pointer; diff --git a/include/llvm/IR/ValueMap.h b/include/llvm/IR/ValueMap.h index fddebe7c72f..42da5297339 100644 --- a/include/llvm/IR/ValueMap.h +++ b/include/llvm/IR/ValueMap.h @@ -198,7 +198,7 @@ class ValueMapCallbackVH : public CallbackVH { friend class ValueMap; friend struct DenseMapInfo; typedef ValueMap ValueMapT; - typedef typename llvm::remove_pointer::type KeySansPointerT; + typedef typename std::remove_pointer::type KeySansPointerT; ValueMapT *Map; diff --git a/include/llvm/Object/ELF.h b/include/llvm/Object/ELF.h index a6774c11503..824e06e7eda 100644 --- a/include/llvm/Object/ELF.h +++ b/include/llvm/Object/ELF.h @@ -51,8 +51,8 @@ template class ELFFile { public: LLVM_ELF_IMPORT_TYPES_ELFT(ELFT) - typedef typename conditional::type uintX_t; + typedef typename std::conditional::type uintX_t; /// \brief Iterate over constant sized entities. template diff --git a/include/llvm/Object/Error.h b/include/llvm/Object/Error.h index 8b0570b02f8..779c747461a 100644 --- a/include/llvm/Object/Error.h +++ b/include/llvm/Object/Error.h @@ -41,10 +41,10 @@ inline error_code make_error_code(object_error e) { } // end namespace object. -template <> struct is_error_code_enum : true_type { }; +template <> struct is_error_code_enum : std::true_type {}; -template <> struct is_error_code_enum : true_type { -}; +template <> +struct is_error_code_enum : std::true_type {}; } // end namespace llvm. diff --git a/include/llvm/Support/Casting.h b/include/llvm/Support/Casting.h index 720c34f7b49..689f5908343 100644 --- a/include/llvm/Support/Casting.h +++ b/include/llvm/Support/Casting.h @@ -59,11 +59,8 @@ struct isa_impl { /// \brief Always allow upcasts, and perform no dynamic check for them. template -struct isa_impl - >::type - > { +struct isa_impl< + To, From, typename std::enable_if::value>::type> { static inline bool doit(const From &) { return true; } }; @@ -209,7 +206,7 @@ template struct cast_convert_val { template struct is_simple_type { static const bool value = - is_same::SimpleType>::value; + std::is_same::SimpleType>::value; }; // cast - Return the argument parameter cast to the specified type. This @@ -220,8 +217,8 @@ template struct is_simple_type { // cast(myVal)->getParent() // template -inline typename enable_if_c::value, - typename cast_retty::ret_type>::type +inline typename std::enable_if::value, + typename cast_retty::ret_type>::type cast(const Y &Val) { assert(isa(Val) && "cast() argument of incompatible type!"); return cast_convert_val< @@ -263,7 +260,7 @@ cast_or_null(Y *Val) { // template -LLVM_ATTRIBUTE_UNUSED_RESULT inline typename enable_if_c< +LLVM_ATTRIBUTE_UNUSED_RESULT inline typename std::enable_if< !is_simple_type::value, typename cast_retty::ret_type>::type dyn_cast(const Y &Val) { return isa(Val) ? cast(Val) : 0; diff --git a/include/llvm/Support/CommandLine.h b/include/llvm/Support/CommandLine.h index b7d1592f137..e49a97ea541 100644 --- a/include/llvm/Support/CommandLine.h +++ b/include/llvm/Support/CommandLine.h @@ -24,7 +24,6 @@ #include "llvm/ADT/StringMap.h" #include "llvm/ADT/Twine.h" #include "llvm/Support/Compiler.h" -#include "llvm/Support/type_traits.h" #include #include #include @@ -422,7 +421,7 @@ struct OptionValueBase : OptionValueCopy { // Top-level option class. template -struct OptionValue : OptionValueBase::value> { +struct OptionValue : OptionValueBase::value> { OptionValue() {} OptionValue(const DataType& V) { @@ -1156,7 +1155,7 @@ template > class opt : public Option, public opt_storage::value> { + std::is_class::value> { ParserClass Parser; bool handleOccurrence(unsigned pos, StringRef ArgName, diff --git a/include/llvm/Support/Endian.h b/include/llvm/Support/Endian.h index 0d358498839..5256ef9fce5 100644 --- a/include/llvm/Support/Endian.h +++ b/include/llvm/Support/Endian.h @@ -17,7 +17,6 @@ #include "llvm/Support/AlignOf.h" #include "llvm/Support/Host.h" #include "llvm/Support/SwapByteOrder.h" -#include "llvm/Support/type_traits.h" namespace llvm { namespace support { diff --git a/include/llvm/Support/ErrorOr.h b/include/llvm/Support/ErrorOr.h index 3054b213593..becd95780e4 100644 --- a/include/llvm/Support/ErrorOr.h +++ b/include/llvm/Support/ErrorOr.h @@ -19,7 +19,6 @@ #include "llvm/ADT/PointerIntPair.h" #include "llvm/Support/AlignOf.h" #include "llvm/Support/system_error.h" -#include "llvm/Support/type_traits.h" #include #include @@ -82,26 +81,22 @@ public: template class ErrorOr { template friend class ErrorOr; - static const bool isRef = is_reference::value; - typedef ReferenceStorage::type> wrap; + static const bool isRef = std::is_reference::value; + typedef ReferenceStorage::type> wrap; public: - typedef typename - conditional< isRef - , wrap - , T - >::type storage_type; + typedef typename std::conditional::type storage_type; private: - typedef typename remove_reference::type &reference; - typedef const typename remove_reference::type &const_reference; - typedef typename remove_reference::type *pointer; + typedef typename std::remove_reference::type &reference; + typedef const typename std::remove_reference::type &const_reference; + typedef typename std::remove_reference::type *pointer; public: template - ErrorOr(E ErrorCode, typename enable_if_c::value || - is_error_condition_enum::value, - void *>::type = 0) + ErrorOr(E ErrorCode, typename std::enable_if::value || + is_error_condition_enum::value, + void *>::type = 0) : HasError(true) { new (getErrorStorage()) error_code(make_error_code(ErrorCode)); } @@ -270,8 +265,8 @@ private: }; template -typename enable_if_c::value || - is_error_condition_enum::value, bool>::type +typename std::enable_if::value || + is_error_condition_enum::value, bool>::type operator ==(ErrorOr &Err, E Code) { return error_code(Err) == Code; } diff --git a/include/llvm/Support/MathExtras.h b/include/llvm/Support/MathExtras.h index 30a1ad45844..2200d4dcb26 100644 --- a/include/llvm/Support/MathExtras.h +++ b/include/llvm/Support/MathExtras.h @@ -16,7 +16,6 @@ #include "llvm/Support/Compiler.h" #include "llvm/Support/SwapByteOrder.h" -#include "llvm/Support/type_traits.h" #include #ifdef _MSC_VER @@ -43,8 +42,8 @@ enum ZeroBehavior { /// \param ZB the behavior on an input of 0. Only ZB_Width and ZB_Undefined are /// valid arguments. template -typename enable_if_c::is_integer && - !std::numeric_limits::is_signed, std::size_t>::type +typename std::enable_if::is_integer && + !std::numeric_limits::is_signed, std::size_t>::type countTrailingZeros(T Val, ZeroBehavior ZB = ZB_Width) { (void)ZB; @@ -70,8 +69,8 @@ countTrailingZeros(T Val, ZeroBehavior ZB = ZB_Width) { // Disable signed. template -typename enable_if_c::is_integer && - std::numeric_limits::is_signed, std::size_t>::type +typename std::enable_if::is_integer && + std::numeric_limits::is_signed, std::size_t>::type countTrailingZeros(T Val, ZeroBehavior ZB = ZB_Width) LLVM_DELETED_FUNCTION; #if __GNUC__ >= 4 || _MSC_VER @@ -114,8 +113,8 @@ inline std::size_t countTrailingZeros(uint64_t Val, ZeroBehavior ZB) { /// \param ZB the behavior on an input of 0. Only ZB_Width and ZB_Undefined are /// valid arguments. template -typename enable_if_c::is_integer && - !std::numeric_limits::is_signed, std::size_t>::type +typename std::enable_if::is_integer && + !std::numeric_limits::is_signed, std::size_t>::type countLeadingZeros(T Val, ZeroBehavior ZB = ZB_Width) { (void)ZB; @@ -136,8 +135,8 @@ countLeadingZeros(T Val, ZeroBehavior ZB = ZB_Width) { // Disable signed. template -typename enable_if_c::is_integer && - std::numeric_limits::is_signed, std::size_t>::type +typename std::enable_if::is_integer && + std::numeric_limits::is_signed, std::size_t>::type countLeadingZeros(T Val, ZeroBehavior ZB = ZB_Width) LLVM_DELETED_FUNCTION; #if __GNUC__ >= 4 || _MSC_VER @@ -180,8 +179,8 @@ inline std::size_t countLeadingZeros(uint64_t Val, ZeroBehavior ZB) { /// \param ZB the behavior on an input of 0. Only ZB_Max and ZB_Undefined are /// valid arguments. template -typename enable_if_c::is_integer && - !std::numeric_limits::is_signed, T>::type +typename std::enable_if::is_integer && + !std::numeric_limits::is_signed, T>::type findFirstSet(T Val, ZeroBehavior ZB = ZB_Max) { if (ZB == ZB_Max && Val == 0) return std::numeric_limits::max(); @@ -191,8 +190,8 @@ findFirstSet(T Val, ZeroBehavior ZB = ZB_Max) { // Disable signed. template -typename enable_if_c::is_integer && - std::numeric_limits::is_signed, T>::type +typename std::enable_if::is_integer && + std::numeric_limits::is_signed, T>::type findFirstSet(T Val, ZeroBehavior ZB = ZB_Max) LLVM_DELETED_FUNCTION; /// \brief Get the index of the last set bit starting from the least @@ -203,8 +202,8 @@ findFirstSet(T Val, ZeroBehavior ZB = ZB_Max) LLVM_DELETED_FUNCTION; /// \param ZB the behavior on an input of 0. Only ZB_Max and ZB_Undefined are /// valid arguments. template -typename enable_if_c::is_integer && - !std::numeric_limits::is_signed, T>::type +typename std::enable_if::is_integer && + !std::numeric_limits::is_signed, T>::type findLastSet(T Val, ZeroBehavior ZB = ZB_Max) { if (ZB == ZB_Max && Val == 0) return std::numeric_limits::max(); @@ -217,8 +216,8 @@ findLastSet(T Val, ZeroBehavior ZB = ZB_Max) { // Disable signed. template -typename enable_if_c::is_integer && - std::numeric_limits::is_signed, T>::type +typename std::enable_if::is_integer && + std::numeric_limits::is_signed, T>::type findLastSet(T Val, ZeroBehavior ZB = ZB_Max) LLVM_DELETED_FUNCTION; /// \brief Macro compressed bit reversal table for 256 bits. diff --git a/include/llvm/Support/YAMLTraits.h b/include/llvm/Support/YAMLTraits.h index e5d2308aee5..e704bf17fe1 100644 --- a/include/llvm/Support/YAMLTraits.h +++ b/include/llvm/Support/YAMLTraits.h @@ -23,8 +23,6 @@ #include "llvm/Support/YAMLParser.h" #include "llvm/Support/raw_ostream.h" #include "llvm/Support/system_error.h" -#include "llvm/Support/type_traits.h" - namespace llvm { namespace yaml { @@ -266,7 +264,7 @@ public: // has_FlowTraits will cause an error with some compilers because // it subclasses int. Using this wrapper only instantiates the // real has_FlowTraits only if the template type is a class. -template ::value> +template ::value> class has_FlowTraits { public: @@ -296,7 +294,7 @@ public: // Test if SequenceTraits is defined on type T template -struct has_SequenceTraits : public llvm::integral_constant::value > { }; @@ -320,7 +318,7 @@ public: template -struct missingTraits : public llvm::integral_constant::value && !has_ScalarBitSetTraits::value && !has_ScalarTraits::value @@ -329,12 +327,12 @@ struct missingTraits : public llvm::integral_constant::value > {}; template -struct validatedMappingTraits : public llvm::integral_constant::value && has_MappingValidateTraits::value> {}; template -struct unvalidatedMappingTraits : public llvm::integral_constant::value && !has_MappingValidateTraits::value> {}; // Base class for Input and Output. @@ -414,7 +412,7 @@ public: } template - typename llvm::enable_if_c::value,void>::type + typename std::enable_if::value,void>::type mapOptional(const char* Key, T& Val) { // omit key/value instead of outputting empty sequence if ( this->canElideEmptySequence() && !(Val.begin() != Val.end()) ) @@ -423,7 +421,7 @@ public: } template - typename llvm::enable_if_c::value,void>::type + typename std::enable_if::value,void>::type mapOptional(const char* Key, T& Val) { this->processKey(Key, Val, false); } @@ -468,7 +466,7 @@ private: template -typename llvm::enable_if_c::value,void>::type +typename std::enable_if::value,void>::type yamlize(IO &io, T &Val, bool) { io.beginEnumScalar(); ScalarEnumerationTraits::enumeration(io, Val); @@ -476,7 +474,7 @@ yamlize(IO &io, T &Val, bool) { } template -typename llvm::enable_if_c::value,void>::type +typename std::enable_if::value,void>::type yamlize(IO &io, T &Val, bool) { bool DoClear; if ( io.beginBitSetScalar(DoClear) ) { @@ -489,7 +487,7 @@ yamlize(IO &io, T &Val, bool) { template -typename llvm::enable_if_c::value,void>::type +typename std::enable_if::value,void>::type yamlize(IO &io, T &Val, bool) { if ( io.outputting() ) { std::string Storage; @@ -510,7 +508,7 @@ yamlize(IO &io, T &Val, bool) { template -typename llvm::enable_if_c::value, void>::type +typename std::enable_if::value, void>::type yamlize(IO &io, T &Val, bool) { io.beginMapping(); if (io.outputting()) { @@ -530,7 +528,7 @@ yamlize(IO &io, T &Val, bool) { } template -typename llvm::enable_if_c::value, void>::type +typename std::enable_if::value, void>::type yamlize(IO &io, T &Val, bool) { io.beginMapping(); MappingTraits::mapping(io, Val); @@ -538,13 +536,13 @@ yamlize(IO &io, T &Val, bool) { } template -typename llvm::enable_if_c::value, void>::type +typename std::enable_if::value, void>::type yamlize(IO &io, T &Val, bool) { char missing_yaml_trait_for_type[sizeof(MissingTrait)]; } template -typename llvm::enable_if_c::value,void>::type +typename std::enable_if::value,void>::type yamlize(IO &io, T &Seq, bool) { if ( has_FlowTraits< SequenceTraits >::value ) { unsigned incnt = io.beginFlowSequence(); @@ -990,7 +988,7 @@ struct ScalarTraits { // Define non-member operator>> so that Input can stream in a document list. template inline -typename llvm::enable_if_c::value,Input &>::type +typename std::enable_if::value, Input &>::type operator>>(Input &yin, T &docList) { int i = 0; while ( yin.setCurrentDocument() ) { @@ -1006,7 +1004,7 @@ operator>>(Input &yin, T &docList) { // Define non-member operator>> so that Input can stream in a map as a document. template inline -typename llvm::enable_if_c::value,Input &>::type +typename std::enable_if::value, Input &>::type operator>>(Input &yin, T &docMap) { yin.setCurrentDocument(); yamlize(yin, docMap, true); @@ -1017,7 +1015,7 @@ operator>>(Input &yin, T &docMap) { // a document. template inline -typename llvm::enable_if_c::value,Input &>::type +typename std::enable_if::value, Input &>::type operator>>(Input &yin, T &docSeq) { if (yin.setCurrentDocument()) yamlize(yin, docSeq, true); @@ -1027,7 +1025,7 @@ operator>>(Input &yin, T &docSeq) { // Provide better error message about types missing a trait specialization template inline -typename llvm::enable_if_c::value,Input &>::type +typename std::enable_if::value, Input &>::type operator>>(Input &yin, T &docSeq) { char missing_yaml_trait_for_type[sizeof(MissingTrait)]; return yin; @@ -1037,7 +1035,7 @@ operator>>(Input &yin, T &docSeq) { // Define non-member operator<< so that Output can stream out document list. template inline -typename llvm::enable_if_c::value,Output &>::type +typename std::enable_if::value, Output &>::type operator<<(Output &yout, T &docList) { yout.beginDocuments(); const size_t count = DocumentListTraits::size(yout, docList); @@ -1054,7 +1052,7 @@ operator<<(Output &yout, T &docList) { // Define non-member operator<< so that Output can stream out a map. template inline -typename llvm::enable_if_c::value,Output &>::type +typename std::enable_if::value, Output &>::type operator<<(Output &yout, T &map) { yout.beginDocuments(); if ( yout.preflightDocument(0) ) { @@ -1068,7 +1066,7 @@ operator<<(Output &yout, T &map) { // Define non-member operator<< so that Output can stream out a sequence. template inline -typename llvm::enable_if_c::value,Output &>::type +typename std::enable_if::value, Output &>::type operator<<(Output &yout, T &seq) { yout.beginDocuments(); if ( yout.preflightDocument(0) ) { @@ -1082,7 +1080,7 @@ operator<<(Output &yout, T &seq) { // Provide better error message about types missing a trait specialization template inline -typename llvm::enable_if_c::value,Output &>::type +typename std::enable_if::value, Output &>::type operator<<(Output &yout, T &seq) { char missing_yaml_trait_for_type[sizeof(MissingTrait)]; return yout; diff --git a/include/llvm/Support/system_error.h b/include/llvm/Support/system_error.h index 97226cc179e..ecd3e3c97df 100644 --- a/include/llvm/Support/system_error.h +++ b/include/llvm/Support/system_error.h @@ -48,10 +48,10 @@ const error_category& generic_category(); const error_category& system_category(); template struct is_error_code_enum - : public false_type {}; + : public std::false_type {}; template struct is_error_condition_enum - : public false_type {}; + : public std::false_type {}; class error_code { @@ -203,7 +203,7 @@ enum class errc wrong_protocol_type // EPROTOTYPE }; -template <> struct is_error_condition_enum : true_type { } +template <> struct is_error_condition_enum : std::true_type { } error_code make_error_code(errc e); error_condition make_error_condition(errc e); @@ -225,7 +225,6 @@ template <> struct hash; */ #include "llvm/Config/llvm-config.h" -#include "llvm/Support/type_traits.h" #include #include @@ -474,11 +473,11 @@ namespace llvm { // is_error_code_enum -template struct is_error_code_enum : public false_type {}; +template struct is_error_code_enum : public std::false_type {}; // is_error_condition_enum -template struct is_error_condition_enum : public false_type {}; +template struct is_error_condition_enum : public std::false_type {}; // Some error codes are not present on all platforms, so we provide equivalents // for them: @@ -613,9 +612,9 @@ enum _ { operator int() const {return v_;} }; -template <> struct is_error_condition_enum : true_type { }; +template <> struct is_error_condition_enum : std::true_type { }; -template <> struct is_error_condition_enum : true_type { }; +template <> struct is_error_condition_enum : std::true_type { }; class error_condition; class error_code; @@ -675,7 +674,7 @@ public: : _val_(_val), _cat_(&_cat) {} template - error_condition(E _e, typename enable_if_c< + error_condition(E _e, typename std::enable_if< is_error_condition_enum::value >::type* = 0) {*this = make_error_condition(_e);} @@ -686,13 +685,12 @@ public: } template - typename enable_if_c - < - is_error_condition_enum::value, - error_condition& - >::type - operator=(E _e) - {*this = make_error_condition(_e); return *this;} + typename std::enable_if::value, + error_condition &>::type + operator=(E _e) { + *this = make_error_condition(_e); + return *this; + } void clear() { _val_ = 0; @@ -737,7 +735,7 @@ public: : _val_(_val), _cat_(&_cat) {} template - error_code(E _e, typename enable_if_c< + error_code(E _e, typename std::enable_if< is_error_code_enum::value >::type* = 0) { *this = make_error_code(_e); @@ -749,13 +747,11 @@ public: } template - typename enable_if_c - < - is_error_code_enum::value, - error_code& - >::type - operator=(E _e) - {*this = make_error_code(_e); return *this;} + typename std::enable_if::value, error_code &>::type + operator=(E _e) { + *this = make_error_code(_e); + return *this; + } void clear() { _val_ = 0; @@ -892,9 +888,9 @@ enum _ { }; -template <> struct is_error_code_enum : true_type { }; +template <> struct is_error_code_enum : std::true_type { }; -template <> struct is_error_code_enum : true_type { }; +template <> struct is_error_code_enum : std::true_type { }; inline error_code make_error_code(windows_error e) { return error_code(static_cast(e), system_category()); diff --git a/unittests/ADT/HashingTest.cpp b/unittests/ADT/HashingTest.cpp index 1b3d0617a5e..60917ae4249 100644 --- a/unittests/ADT/HashingTest.cpp +++ b/unittests/ADT/HashingTest.cpp @@ -41,7 +41,7 @@ struct NonPOD { namespace hashing { namespace detail { -template <> struct is_hashable_data : true_type {}; +template <> struct is_hashable_data : std::true_type {}; } // namespace detail } // namespace hashing diff --git a/unittests/ADT/TinyPtrVectorTest.cpp b/unittests/ADT/TinyPtrVectorTest.cpp index d633f967221..ec868d4258a 100644 --- a/unittests/ADT/TinyPtrVectorTest.cpp +++ b/unittests/ADT/TinyPtrVectorTest.cpp @@ -36,7 +36,7 @@ template class TinyPtrVectorTest : public testing::Test { protected: typedef typename VectorT::value_type PtrT; - typedef typename remove_pointer::type ValueT; + typedef typename std::remove_pointer::type ValueT; VectorT V; VectorT V2; diff --git a/unittests/Support/Casting.cpp b/unittests/Support/Casting.cpp index 04451788951..228c90bb8b7 100644 --- a/unittests/Support/Casting.cpp +++ b/unittests/Support/Casting.cpp @@ -77,12 +77,16 @@ using namespace llvm; // Test the peculiar behavior of Use in simplify_type. -int Check1[is_same::SimpleType, Value *>::value ? 1 : -1]; -int Check2[is_same::SimpleType, Value *>::value ? 1 : -1]; +static_assert(std::is_same::SimpleType, Value *>::value, + "Use doesn't simplify correctly!"); +static_assert(std::is_same::SimpleType, Value *>::value, + "Use doesn't simplify correctly!"); // Test that a regular class behaves as expected. -int Check3[is_same::SimpleType, int>::value ? 1 : -1]; -int Check4[is_same::SimpleType, foo *>::value ? 1 : -1]; +static_assert(std::is_same::SimpleType, int>::value, + "Unexpected simplify_type result!"); +static_assert(std::is_same::SimpleType, foo *>::value, + "Unexpected simplify_type result!"); namespace {