Commit Graph

27 Commits

Author SHA1 Message Date
Alexis Hunt 397d787642 Given that __underlying_type is now available in clang, implement
std::underlying_type.

llvm-svn: 135410
2011-07-18 18:37:21 +00:00
Howard Hinnant 3739fe79e5 noexcept for <memory>. I've added a few extension noexcept to: allocator_traits<A>::deallocate, allocaate<T>::deallocate, return_temporary_buffer, and default_delete<T>::operator()(T*) const. My rationale was: If a std-dicated noexcept function needs to call another std-defined function, that called function must be noexcept. We're all a little new to noexcept, so things like this are to be expected. Also included fix for broken __is_swappable trait pointed out by Marc Glisse, thanks Marc|. And fixed a test case for is_nothrow_destructible. Destructors are now noexcept by default|
llvm-svn: 132261
2011-05-28 14:41:13 +00:00
Howard Hinnant 15c34d48ba Redesign of result_of to handle reference-qualified member functions
llvm-svn: 131407
2011-05-16 16:17:21 +00:00
Howard Hinnant 467fc38320 A much improved type_traits for C++0x. Not yet done: is_trivially_constructible, is_trivially_assignable and underlying_type.
llvm-svn: 131291
2011-05-13 14:08:16 +00:00
Howard Hinnant d44be13fa8 minor corrections to test, and hook is_base_of up to clang intrinsic
llvm-svn: 124502
2011-01-28 20:00:37 +00:00
Howard Hinnant 389eb9b54a placeholder test
llvm-svn: 124193
2011-01-25 16:32:04 +00:00
Douglas Gregor a7b2241407 Eliminate the C++0x-only is_convertible testing function that accepts
a cv-qualifier rvalue reference to the type, e.g.,

  template <class _Tp> char  __test(const volatile typename remove_reference<_Tp>::type&&);

The use of this function signature rather than the more
straightforward one used in C++98/03 mode, e.g.,

  template <class _Tp> char  __test(_Tp);

is broken in two ways:

  1) An rvalue reference cannot bind to lvalues, so is_convertible<X&,
  X&>::value would be false. This breaks two of the unique_ptr tests
  on Clang and GCC >= 4.5. Prior GCC's seem to have allowed rvalue
  references to bind to lvalues, allowing this bug to slip in.

  2) By adding cv-qualifiers to the type we're converting to, we get
  some incorrect "true" results for, e.g., is_convertible<const X&, X&>::value.

llvm-svn: 124166
2011-01-25 01:15:41 +00:00
Howard Hinnant e5cb278766 Update testsuite strucuture to latest draft
llvm-svn: 120029
2010-11-23 19:15:49 +00:00
Howard Hinnant 092980dd65 N3123
llvm-svn: 119906
2010-11-20 18:25:22 +00:00
Howard Hinnant ca74048398 N3142. Many of these traits are just placeholders with medium quality emulation; waiting on compiler intrinsics to do it right.
llvm-svn: 119854
2010-11-19 22:17:28 +00:00
Howard Hinnant 412dbebe1b license change
llvm-svn: 119395
2010-11-16 22:09:02 +00:00
Howard Hinnant 10b9b7b4bd Hooked the following up to clang: is_class, is_enum, has_nothrow_copy_assign, has_trivial_destructor, has_virtual_destructor, is_pod. Implemented has_copy_assign.
llvm-svn: 113373
2010-09-08 17:55:32 +00:00
Howard Hinnant 1be27f0929 has_nothrow_copy_assign hooked up to clang
llvm-svn: 113364
2010-09-08 16:39:18 +00:00
Howard Hinnant 331b3dd2ad has_trivial_copy_assign hooked up to clang (without workarounds). Filed http://llvm.org/bugs/show_bug.cgi?id=8109 to take care of several types which don't work yet. If there is some reason we don't want to handle these types in the compiler, I can handle most of them in the library.
llvm-svn: 113312
2010-09-07 23:38:59 +00:00
Howard Hinnant bfc4026f4c Made a stab at has_copy_constructor. Got it mostly working for g++-4.0, but only works for scalar types on clang. Ultimately this needs a compiler-supported is_constructible which clang is missing, and won't be able to use until it gets variadic templates.
llvm-svn: 113304
2010-09-07 23:11:28 +00:00
Howard Hinnant 06fc97019a has_nothrow_copy_constructor hooked up to clang. Filed http://llvm.org/bugs/show_bug.cgi?id=8107 to take care of several types which don't work yet. If there is some reason we don't want to handle these types in the compiler, I can handle most of them in the library.
llvm-svn: 113294
2010-09-07 22:09:07 +00:00
Howard Hinnant 01fd31000b has_trivial_copy_constructor hooked up to clang. Filed http://llvm.org/bugs/show_bug.cgi?id=8105 to take care of void, arrays of incomplete bounds and complete bounds which don't work yet. If there is some reason we don't want to handle these types in the compiler, I can handle them in the library.
llvm-svn: 113270
2010-09-07 20:31:18 +00:00
Howard Hinnant ba6f71b030 Made a stab at has_default_constructor. Got it mostly working for g++-4.0, but only works for scalar types on clang. Ultimately this needs a compiler-supported is_constructible which clang is missing, and won't be able to use until it gets variadic templates.
llvm-svn: 113225
2010-09-07 17:47:31 +00:00
Howard Hinnant f336abfcd2 has_nothrow_default_constructor hooked up to clang. Filed http://llvm.org/bugs/show_bug.cgi?id=8101 to take care of void, arrays of incomplete types, and classes with virtual destructors which don't work yet. If there is some reasons we don't want to handle these types in the compiler, I can handle them in the library.
llvm-svn: 113217
2010-09-07 17:15:17 +00:00
Howard Hinnant c3ed8c312e has_trivial_default_constructor hooked up to clang. Filed http://llvm.org/bugs/show_bug.cgi?id=8097 to take care of void and arrays of incomplete types which don't work yet. If there is some reasons we don't want to handle these types in the compiler, I can handle them in the library.
llvm-svn: 113205
2010-09-07 15:53:26 +00:00
Howard Hinnant db3e9975d0 Working the type_traits area: Hooked up to clang's __is_union. Got has_trivial_copy_assign working.
llvm-svn: 113162
2010-09-06 19:10:31 +00:00
Howard Hinnant 7609c9b665 Changed __config to react to all of clang's currently documented has_feature flags, and renamed _LIBCPP_MOVE to _LIBCPP_HAS_NO_RVALUE_REFERENCES to be more consistent with the rest of the libc++'s flags, and with clang's nomenclature.
llvm-svn: 113086
2010-09-04 23:28:19 +00:00
Howard Hinnant 94b2dd0998 Fixing whitespace problems
llvm-svn: 111767
2010-08-22 00:59:46 +00:00
Howard Hinnant de6d046575 DE 19
llvm-svn: 111544
2010-08-19 19:09:08 +00:00
Howard Hinnant 5e2f7b89e9 Updated by-chapter chart with weekly test results. Also did some prototyping on result_of, but if-def'd out the prototyped part (which the LWG may or may not accept)
llvm-svn: 111389
2010-08-18 18:52:04 +00:00
Howard Hinnant 5b08a8a432 Wiped out some non-ascii characters that snuck into the copyright.
llvm-svn: 103516
2010-05-11 21:36:01 +00:00
Howard Hinnant 3e519524c1 libcxx initial import
llvm-svn: 103490
2010-05-11 19:42:16 +00:00