llvm.org GIT mirror llvm / c1dafe8
[C++11] Replace LLVM-style type traits with C++11 standard ones. No functionality change. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@203242 91177308-0d34-0410-b5e6-96231b3b80d8 Benjamin Kramer 5 years ago
18 changed file(s) with 121 addition(s) and 135 deletion(s). Raw diff Collapse all Expand all
222222 [...]
223223 template
224224 static bool classof(const T *,
225 ::llvm::enable_if_c<
226 ::llvm::is_base_of::value
225 ::std::enable_if<
226 ::std::is_base_of::value
227227 >::type* = 0) { return true; }
228228 [...]
229229 };
976976 friend class DenseMapIterator;
977977 public:
978978 typedef ptrdiff_t difference_type;
979 typedef typename conditional::type value_type;
979 typedef typename std::conditional::type
980 value_type;
980981 typedef value_type *pointer;
981982 typedef value_type &reference;
982983 typedef std::forward_iterator_tag iterator_category;
108108 /// differing argument types even if they would implicit promote to a common
109109 /// type without changing the value.
110110 template
111 typename enable_if, hash_code>::type hash_value(T value);
111 typename std::enable_if::value, hash_code>::type
112 hash_value(T value);
112113
113114 /// \brief Compute a hash_code for a pointer's address.
114115 ///
351352 // and pointers, but there are platforms where it doesn't and we would like to
352353 // support user-defined types which happen to satisfy this property.
353354 template struct is_hashable_data
354 : integral_constant::value ||
355 is_pointer::value) &&
356 64 % sizeof(T) == 0)> {};
355 : std::integral_constant::value ||
356 std::is_pointer::value) &&
357 64 % sizeof(T) == 0)> {};
357358
358359 // Special case std::pair to detect when both types are viable and when there
359360 // is no alignment-derived padding in the pair. This is a bit of a lie because
360361 // std::pair isn't truly POD, but it's close enough in all reasonable
361362 // implementations for our use case of hashing the underlying data.
362363 template struct is_hashable_data >
363 : integral_constant::value &&
364 is_hashable_data::value &&
365 (sizeof(T) + sizeof(U)) ==
366 sizeof(std::pair))> {};
364 : std::integral_constant::value &&
365 is_hashable_data::value &&
366 (sizeof(T) + sizeof(U)) ==
367 sizeof(std::pair))> {};
367368
368369 /// \brief Helper to get the hashable data representation for a type.
369370 /// This variant is enabled when the type itself can be used.
370371 template
371 typename enable_if, T>::type
372 typename std::enable_if::value, T>::type
372373 get_hashable_data(const T &value) {
373374 return value;
374375 }
376377 /// This variant is enabled when we must first call hash_value and use the
377378 /// result as our data.
378379 template
379 typename enable_if_c::value, size_t>::type
380 typename std::enable_if::value, size_t>::type
380381 get_hashable_data(const T &value) {
381382 using ::llvm::hash_value;
382383 return hash_value(value);
450451 /// are stored in contiguous memory, this routine avoids copying each value
451452 /// and directly reads from the underlying memory.
452453 template
453 typename enable_if, hash_code>::type
454 typename std::enable_if::value, hash_code>::type
454455 hash_combine_range_impl(ValueT *first, ValueT *last) {
455456 const size_t seed = get_execution_seed();
456457 const char *s_begin = reinterpret_cast(first);
733734 // Declared and documented above, but defined here so that any of the hashing
734735 // infrastructure is available.
735736 template
736 typename enable_if, hash_code>::type
737 typename std::enable_if::value, hash_code>::type
737738 hash_value(T value) {
738739 return ::llvm::hashing::detail::hash_integer_value(value);
739740 }
1010 #define LLVM_ADT_STRINGREF_H
1111
1212 #include "llvm/Support/Allocator.h"
13 #include "llvm/Support/type_traits.h"
1413 #include
1514 #include
1615 #include
340339 /// this returns true to signify the error. The string is considered
341340 /// erroneous if empty or if it overflows T.
342341 template
343 typename enable_if_c::is_signed, bool>::type
342 typename std::enable_if::is_signed, bool>::type
344343 getAsInteger(unsigned Radix, T &Result) const {
345344 long long LLVal;
346345 if (getAsSignedInteger(*this, Radix, LLVal) ||
351350 }
352351
353352 template
354 typename enable_if_c::is_signed, bool>::type
353 typename std::enable_if::is_signed, bool>::type
355354 getAsInteger(unsigned Radix, T &Result) const {
356355 unsigned long long ULLVal;
357356 if (getAsUnsignedInteger(*this, Radix, ULLVal) ||
495495 //@{
496496 template
497497 class block_iterator_wrapper
498 : public df_iterator
499 const BasicBlock,
500 BasicBlock>::type*> {
501 typedef df_iterator
502 const BasicBlock,
503 BasicBlock>::type*>
504 super;
498 : public df_iterator
499 BasicBlock>::type *> {
500 typedef df_iterator
501 BasicBlock>::type *> super;
502
505503 public:
506504 typedef block_iterator_wrapper Self;
507505 typedef typename super::pointer pointer;
197197 friend class ValueMap;
198198 friend struct DenseMapInfo;
199199 typedef ValueMap ValueMapT;
200 typedef typename llvm::remove_pointer::type KeySansPointerT;
200 typedef typename std::remove_pointer::type KeySansPointerT;
201201
202202 ValueMapT *Map;
203203
5050 class ELFFile {
5151 public:
5252 LLVM_ELF_IMPORT_TYPES_ELFT(ELFT)
53 typedef typename conditional
54 uint64_t, uint32_t>::type uintX_t;
53 typedef typename std::conditional
54 uint64_t, uint32_t>::type uintX_t;
5555
5656 /// \brief Iterate over constant sized entities.
5757 template
4040
4141 } // end namespace object.
4242
43 template <> struct is_error_code_enum : true_type { };
43 template <> struct is_error_code_enum : std::true_type {};
4444
45 template <> struct is_error_code_enum : true_type {
46 };
45 template <>
46 struct is_error_code_enum : std::true_type {};
4747
4848 } // end namespace llvm.
4949
5858
5959 /// \brief Always allow upcasts, and perform no dynamic check for them.
6060 template
61 struct isa_impl
62 typename enable_if<
63 llvm::is_base_of
64 >::type
65 > {
61 struct isa_impl<
62 To, From, typename std::enable_if::value>::type> {
6663 static inline bool doit(const From &) { return true; }
6764 };
6865
208205
209206 template struct is_simple_type {
210207 static const bool value =
211 is_same::SimpleType>::value;
208 std::is_same::SimpleType>::value;
212209 };
213210
214211 // cast - Return the argument parameter cast to the specified type. This
219216 // cast(myVal)->getParent()
220217 //
221218 template
222 inline typename enable_if_c::value,
223 typename cast_retty::ret_type>::type
219 inline typename std::enable_if::value,
220 typename cast_retty::ret_type>::type
224221 cast(const Y &Val) {
225222 assert(isa(Val) && "cast() argument of incompatible type!");
226223 return cast_convert_val<
262259 //
263260
264261 template
265 LLVM_ATTRIBUTE_UNUSED_RESULT inline typename enable_if_c<
262 LLVM_ATTRIBUTE_UNUSED_RESULT inline typename std::enable_if<
266263 !is_simple_type::value, typename cast_retty::ret_type>::type
267264 dyn_cast(const Y &Val) {
268265 return isa(Val) ? cast(Val) : 0;
2323 #include "llvm/ADT/StringMap.h"
2424 #include "llvm/ADT/Twine.h"
2525 #include "llvm/Support/Compiler.h"
26 #include "llvm/Support/type_traits.h"
2726 #include
2827 #include
2928 #include
421420
422421 // Top-level option class.
423422 template
424 struct OptionValue : OptionValueBaseis_class::value> {
423 struct OptionValue : OptionValueBasestd::is_class::value> {
425424 OptionValue() {}
426425
427426 OptionValue(const DataType& V) {
11551154 class ParserClass = parser >
11561155 class opt : public Option,
11571156 public opt_storage
1158 is_class::value> {
1157 std::is_class::value> {
11591158 ParserClass Parser;
11601159
11611160 bool handleOccurrence(unsigned pos, StringRef ArgName,
1616 #include "llvm/Support/AlignOf.h"
1717 #include "llvm/Support/Host.h"
1818 #include "llvm/Support/SwapByteOrder.h"
19 #include "llvm/Support/type_traits.h"
2019
2120 namespace llvm {
2221 namespace support {
1818 #include "llvm/ADT/PointerIntPair.h"
1919 #include "llvm/Support/AlignOf.h"
2020 #include "llvm/Support/system_error.h"
21 #include "llvm/Support/type_traits.h"
2221 #include
2322 #include
2423
8180 template
8281 class ErrorOr {
8382 template friend class ErrorOr;
84 static const bool isRef = is_reference::value;
85 typedef ReferenceStorage::type> wrap;
83 static const bool isRef = std::is_reference::value;
84 typedef ReferenceStorage::type> wrap;
8685
8786 public:
88 typedef typename
89 conditional< isRef
90 , wrap
91 , T
92 >::type storage_type;
87 typedef typename std::conditional>::type storage_type;
9388
9489 private:
95 typedef typename remove_reference::type &reference;
96 typedef const typename remove_reference::type &const_reference;
97 typedef typename remove_reference::type *pointer;
90 typedef typename std::remove_reference::type &reference;
91 typedef const typename std::remove_reference::type &const_reference;
92 typedef typename std::remove_reference::type *pointer;
9893
9994 public:
10095 template
101 ErrorOr(E ErrorCode, typename enable_if_c::value ||
102 is_error_condition_enum::value,
103 void *>::type = 0)
96 ErrorOr(E ErrorCode, typename std::enable_if::value ||
97 is_error_condition_enum::value,
98 void *>::type = 0)
10499 : HasError(true) {
105100 new (getErrorStorage()) error_code(make_error_code(ErrorCode));
106101 }
269264 };
270265
271266 template
272 typename enable_if_c::value ||
273 is_error_condition_enum::value, bool>::type
267 typename std::enable_if::value ||
268 is_error_condition_enum::value, bool>::type
274269 operator ==(ErrorOr &Err, E Code) {
275270 return error_code(Err) == Code;
276271 }
1515
1616 #include "llvm/Support/Compiler.h"
1717 #include "llvm/Support/SwapByteOrder.h"
18 #include "llvm/Support/type_traits.h"
1918 #include
2019
2120 #ifdef _MSC_VER
4241 /// \param ZB the behavior on an input of 0. Only ZB_Width and ZB_Undefined are
4342 /// valid arguments.
4443 template
45 typename enable_if_c::is_integer &&
46 !std::numeric_limits::is_signed, std::size_t>::type
44 typename std::enable_if::is_integer &&
45 !std::numeric_limits::is_signed, std::size_t>::type
4746 countTrailingZeros(T Val, ZeroBehavior ZB = ZB_Width) {
4847 (void)ZB;
4948
6968
7069 // Disable signed.
7170 template
72 typename enable_if_c::is_integer &&
73 std::numeric_limits::is_signed, std::size_t>::type
71 typename std::enable_if::is_integer &&
72 std::numeric_limits::is_signed, std::size_t>::type
7473 countTrailingZeros(T Val, ZeroBehavior ZB = ZB_Width) LLVM_DELETED_FUNCTION;
7574
7675 #if __GNUC__ >= 4 || _MSC_VER
113112 /// \param ZB the behavior on an input of 0. Only ZB_Width and ZB_Undefined are
114113 /// valid arguments.
115114 template
116 typename enable_if_c::is_integer &&
117 !std::numeric_limits::is_signed, std::size_t>::type
115 typename std::enable_if::is_integer &&
116 !std::numeric_limits::is_signed, std::size_t>::type
118117 countLeadingZeros(T Val, ZeroBehavior ZB = ZB_Width) {
119118 (void)ZB;
120119
135134
136135 // Disable signed.
137136 template
138 typename enable_if_c::is_integer &&
139 std::numeric_limits::is_signed, std::size_t>::type
137 typename std::enable_if::is_integer &&
138 std::numeric_limits::is_signed, std::size_t>::type
140139 countLeadingZeros(T Val, ZeroBehavior ZB = ZB_Width) LLVM_DELETED_FUNCTION;
141140
142141 #if __GNUC__ >= 4 || _MSC_VER
179178 /// \param ZB the behavior on an input of 0. Only ZB_Max and ZB_Undefined are
180179 /// valid arguments.
181180 template
182 typename enable_if_c::is_integer &&
183 !std::numeric_limits::is_signed, T>::type
181 typename std::enable_if::is_integer &&
182 !std::numeric_limits::is_signed, T>::type
184183 findFirstSet(T Val, ZeroBehavior ZB = ZB_Max) {
185184 if (ZB == ZB_Max && Val == 0)
186185 return std::numeric_limits::max();
190189
191190 // Disable signed.
192191 template
193 typename enable_if_c::is_integer &&
194 std::numeric_limits::is_signed, T>::type
192 typename std::enable_if::is_integer &&
193 std::numeric_limits::is_signed, T>::type
195194 findFirstSet(T Val, ZeroBehavior ZB = ZB_Max) LLVM_DELETED_FUNCTION;
196195
197196 /// \brief Get the index of the last set bit starting from the least
202201 /// \param ZB the behavior on an input of 0. Only ZB_Max and ZB_Undefined are
203202 /// valid arguments.
204203 template
205 typename enable_if_c::is_integer &&
206 !std::numeric_limits::is_signed, T>::type
204 typename std::enable_if::is_integer &&
205 !std::numeric_limits::is_signed, T>::type
207206 findLastSet(T Val, ZeroBehavior ZB = ZB_Max) {
208207 if (ZB == ZB_Max && Val == 0)
209208 return std::numeric_limits::max();
216215
217216 // Disable signed.
218217 template
219 typename enable_if_c::is_integer &&
220 std::numeric_limits::is_signed, T>::type
218 typename std::enable_if::is_integer &&
219 std::numeric_limits::is_signed, T>::type
221220 findLastSet(T Val, ZeroBehavior ZB = ZB_Max) LLVM_DELETED_FUNCTION;
222221
223222 /// \brief Macro compressed bit reversal table for 256 bits.
2222 #include "llvm/Support/YAMLParser.h"
2323 #include "llvm/Support/raw_ostream.h"
2424 #include "llvm/Support/system_error.h"
25 #include "llvm/Support/type_traits.h"
26
2725
2826 namespace llvm {
2927 namespace yaml {
265263 // has_FlowTraits will cause an error with some compilers because
266264 // it subclasses int. Using this wrapper only instantiates the
267265 // real has_FlowTraits only if the template type is a class.
268 template llvm::is_class::value>
266 template std::is_class::value>
269267 class has_FlowTraits
270268 {
271269 public:
295293
296294 // Test if SequenceTraits is defined on type T
297295 template
298 struct has_SequenceTraits : public llvm::integral_constant
296 struct has_SequenceTraits : public std::integral_constant
299297 has_SequenceMethodTraits::value > { };
300298
301299
319317
320318
321319 template
322 struct missingTraits : public llvm::integral_constant
320 struct missingTraits : public std::integral_constant
323321 !has_ScalarEnumerationTraits::value
324322 && !has_ScalarBitSetTraits::value
325323 && !has_ScalarTraits::value
328326 && !has_DocumentListTraits::value > {};
329327
330328 template
331 struct validatedMappingTraits : public llvm::integral_constant
329 struct validatedMappingTraits : public std::integral_constant
332330 has_MappingTraits::value
333331 && has_MappingValidateTraits::value> {};
334332
335333 template
336 struct unvalidatedMappingTraits : public llvm::integral_constant
334 struct unvalidatedMappingTraits : public std::integral_constant
337335 has_MappingTraits::value
338336 && !has_MappingValidateTraits::value> {};
339337 // Base class for Input and Output.
413411 }
414412
415413 template
416 typename llvm::enable_if_c::value,void>::type
414 typename std::enable_if::value,void>::type
417415 mapOptional(const char* Key, T& Val) {
418416 // omit key/value instead of outputting empty sequence
419417 if ( this->canElideEmptySequence() && !(Val.begin() != Val.end()) )
422420 }
423421
424422 template
425 typename llvm::enable_if_c::value,void>::type
423 typename std::enable_if::value,void>::type
426424 mapOptional(const char* Key, T& Val) {
427425 this->processKey(Key, Val, false);
428426 }
467465
468466
469467 template
470 typename llvm::enable_if_c::value,void>::type
468 typename std::enable_if::value,void>::type
471469 yamlize(IO &io, T &Val, bool) {
472470 io.beginEnumScalar();
473471 ScalarEnumerationTraits::enumeration(io, Val);
475473 }
476474
477475 template
478 typename llvm::enable_if_c::value,void>::type
476 typename std::enable_if::value,void>::type
479477 yamlize(IO &io, T &Val, bool) {
480478 bool DoClear;
481479 if ( io.beginBitSetScalar(DoClear) ) {
488486
489487
490488 template
491 typename llvm::enable_if_c::value,void>::type
489 typename std::enable_if::value,void>::type
492490 yamlize(IO &io, T &Val, bool) {
493491 if ( io.outputting() ) {
494492 std::string Storage;
509507
510508
511509 template
512 typename llvm::enable_if_c::value, void>::type
510 typename std::enable_if::value, void>::type
513511 yamlize(IO &io, T &Val, bool) {
514512 io.beginMapping();
515513 if (io.outputting()) {
529527 }
530528
531529 template
532 typename llvm::enable_if_c::value, void>::type
530 typename std::enable_if::value, void>::type
533531 yamlize(IO &io, T &Val, bool) {
534532 io.beginMapping();
535533 MappingTraits::mapping(io, Val);
537535 }
538536
539537 template
540 typename llvm::enable_if_c::value, void>::type
538 typename std::enable_if::value, void>::type
541539 yamlize(IO &io, T &Val, bool) {
542540 char missing_yaml_trait_for_type[sizeof(MissingTrait)];
543541 }
544542
545543 template
546 typename llvm::enable_if_c::value,void>::type
544 typename std::enable_if::value,void>::type
547545 yamlize(IO &io, T &Seq, bool) {
548546 if ( has_FlowTraits< SequenceTraits >::value ) {
549547 unsigned incnt = io.beginFlowSequence();
989987 // Define non-member operator>> so that Input can stream in a document list.
990988 template
991989 inline
992 typename llvm::enable_if_c::value,Input &>::type
990 typename std::enable_if::value, Input &>::type
993991 operator>>(Input &yin, T &docList) {
994992 int i = 0;
995993 while ( yin.setCurrentDocument() ) {
10051003 // Define non-member operator>> so that Input can stream in a map as a document.
10061004 template
10071005 inline
1008 typename llvm::enable_if_c::value,Input &>::type
1006 typename std::enable_if::value, Input &>::type
10091007 operator>>(Input &yin, T &docMap) {
10101008 yin.setCurrentDocument();
10111009 yamlize(yin, docMap, true);
10161014 // a document.
10171015 template
10181016 inline
1019 typename llvm::enable_if_c::value,Input &>::type
1017 typename std::enable_if::value, Input &>::type
10201018 operator>>(Input &yin, T &docSeq) {
10211019 if (yin.setCurrentDocument())
10221020 yamlize(yin, docSeq, true);
10261024 // Provide better error message about types missing a trait specialization
10271025 template
10281026 inline
1029 typename llvm::enable_if_c::value,Input &>::type
1027 typename std::enable_if::value, Input &>::type
10301028 operator>>(Input &yin, T &docSeq) {
10311029 char missing_yaml_trait_for_type[sizeof(MissingTrait)];
10321030 return yin;
10361034 // Define non-member operator<< so that Output can stream out document list.
10371035 template
10381036 inline
1039 typename llvm::enable_if_c::value,Output &>::type
1037 typename std::enable_if::value, Output &>::type
10401038 operator<<(Output &yout, T &docList) {
10411039 yout.beginDocuments();
10421040 const size_t count = DocumentListTraits::size(yout, docList);
10531051 // Define non-member operator<< so that Output can stream out a map.
10541052 template
10551053 inline
1056 typename llvm::enable_if_c::value,Output &>::type
1054 typename std::enable_if::value, Output &>::type
10571055 operator<<(Output &yout, T &map) {
10581056 yout.beginDocuments();
10591057 if ( yout.preflightDocument(0) ) {
10671065 // Define non-member operator<< so that Output can stream out a sequence.
10681066 template
10691067 inline
1070 typename llvm::enable_if_c::value,Output &>::type
1068 typename std::enable_if::value, Output &>::type
10711069 operator<<(Output &yout, T &seq) {
10721070 yout.beginDocuments();
10731071 if ( yout.preflightDocument(0) ) {
10811079 // Provide better error message about types missing a trait specialization
10821080 template
10831081 inline
1084 typename llvm::enable_if_c::value,Output &>::type
1082 typename std::enable_if::value, Output &>::type
10851083 operator<<(Output &yout, T &seq) {
10861084 char missing_yaml_trait_for_type[sizeof(MissingTrait)];
10871085 return yout;
4747 const error_category& system_category();
4848
4949 template struct is_error_code_enum
50 : public false_type {};
50 : public std::false_type {};
5151
5252 template struct is_error_condition_enum
53 : public false_type {};
53 : public std::false_type {};
5454
5555 class error_code
5656 {
202202 wrong_protocol_type // EPROTOTYPE
203203 };
204204
205 template <> struct is_error_condition_enum : true_type { }
205 template <> struct is_error_condition_enum : std::true_type { }
206206
207207 error_code make_error_code(errc e);
208208 error_condition make_error_condition(errc e);
224224 */
225225
226226 #include "llvm/Config/llvm-config.h"
227 #include "llvm/Support/type_traits.h"
228227 #include
229228 #include
230229
473472
474473 // is_error_code_enum
475474
476 template struct is_error_code_enum : public false_type {};
475 template struct is_error_code_enum : public std::false_type {};
477476
478477 // is_error_condition_enum
479478
480 template struct is_error_condition_enum : public false_type {};
479 template struct is_error_condition_enum : public std::false_type {};
481480
482481 // Some error codes are not present on all platforms, so we provide equivalents
483482 // for them:
612611 operator int() const {return v_;}
613612 };
614613
615 template <> struct is_error_condition_enum : true_type { };
616
617 template <> struct is_error_condition_enum::_> : true_type { };
614 template <> struct is_error_condition_enum> : std::true_type { };
615
616 template <> struct is_error_condition_enum : std::true_type { };
618617
619618 class error_condition;
620619 class error_code;
674673 : _val_(_val), _cat_(&_cat) {}
675674
676675 template
677 error_condition(E _e, typename enable_if_c<
676 error_condition(E _e, typename std::enable_if<
678677 is_error_condition_enum::value
679678 >::type* = 0)
680679 {*this = make_error_condition(_e);}
685684 }
686685
687686 template
688 typename enable_if_c
689 <
690 is_error_condition_enum::value,
691 error_condition&
692 >::type
693 operator=(E _e)
694 {*this = make_error_condition(_e); return *this;}
687 typename std::enable_if::value,
688 error_condition &>::type
689 operator=(E _e) {
690 *this = make_error_condition(_e);
691 return *this;
692 }
695693
696694 void clear() {
697695 _val_ = 0;
736734 : _val_(_val), _cat_(&_cat) {}
737735
738736 template
739 error_code(E _e, typename enable_if_c<
737 error_code(E _e, typename std::enable_if<
740738 is_error_code_enum::value
741739 >::type* = 0) {
742740 *this = make_error_code(_e);
748746 }
749747
750748 template
751 typename enable_if_c
752 <
753 is_error_code_enum::value,
754 error_code&
755 >::type
756 operator=(E _e)
757 {*this = make_error_code(_e); return *this;}
749 typename std::enable_if::value, error_code &>::type
750 operator=(E _e) {
751 *this = make_error_code(_e);
752 return *this;
753 }
758754
759755 void clear() {
760756 _val_ = 0;
891887 };
892888
893889
894 template <> struct is_error_code_enum : true_type { };
895
896 template <> struct is_error_code_enum::_> : true_type { };
890 template <> struct is_error_code_enum> : std::true_type { };
891
892 template <> struct is_error_code_enum : std::true_type { };
897893
898894 inline error_code make_error_code(windows_error e) {
899895 return error_code(static_cast(e), system_category());
4040
4141 namespace hashing {
4242 namespace detail {
43 template <> struct is_hashable_data : true_type {};
43 template <> struct is_hashable_data : std::true_type {};
4444 } // namespace detail
4545 } // namespace hashing
4646
3535 class TinyPtrVectorTest : public testing::Test {
3636 protected:
3737 typedef typename VectorT::value_type PtrT;
38 typedef typename remove_pointer::type ValueT;
38 typedef typename std::remove_pointer::type ValueT;
3939
4040 VectorT V;
4141 VectorT V2;
7676
7777
7878 // Test the peculiar behavior of Use in simplify_type.
79 int Check1[is_same::SimpleType, Value *>::value ? 1 : -1];
80 int Check2[is_same::SimpleType, Value *>::value ? 1 : -1];
79 static_assert(std::is_same::SimpleType, Value *>::value,
80 "Use doesn't simplify correctly!");
81 static_assert(std::is_same::SimpleType, Value *>::value,
82 "Use doesn't simplify correctly!");
8183
8284 // Test that a regular class behaves as expected.
83 int Check3[is_same::SimpleType, int>::value ? 1 : -1];
84 int Check4[is_same::SimpleType, foo *>::value ? 1 : -1];
85 static_assert(std::is_same::SimpleType, int>::value,
86 "Unexpected simplify_type result!");
87 static_assert(std::is_same::SimpleType, foo *>::value,
88 "Unexpected simplify_type result!");
8589
8690 namespace {
8791