[PATCH] D27068: Improve string::find

2016-12-01 Thread Tim Song via Phabricator via cfe-commits
tcanens added inline comments. Comment at: include/__string:543 +_LIBCPP_CONSTEXPR_AFTER_CXX11 +_RandomAccessIterator +__search_substring(_RandomAccessIterator __first1, _RandomAccessIterator __last1, A character traits class need only accept pointers, so the

[PATCH] D38075: Fix PR34668 - P0704R1 implementation is too permissive

2017-09-20 Thread Tim Song via Phabricator via cfe-commits
tcanens added inline comments. Comment at: lib/Sema/SemaExprCXX.cpp:5185 if (!isIndirect && !LHS.get()->Classify(Context).isLValue()) { // C++2a allows functions with ref-qualifier & if they are also 'const'. +if (Proto->isConst() &&

[PATCH] D38075: Fix PR34668 - P0704R1 implementation is too permissive

2017-09-20 Thread Tim Song via Phabricator via cfe-commits
tcanens created this revision. tcanens added a project: clang. https://bugs.llvm.org/show_bug.cgi?id=34668 Pretty straightforward. Repository: rL LLVM https://reviews.llvm.org/D38075 Files: lib/Sema/SemaExprCXX.cpp test/SemaCXX/cxx2a-pointer-to-const-ref-member.cpp Index:

[PATCH] D38075: Fix PR34668 - P0704R1 implementation is too permissive

2017-09-25 Thread Tim Song via Phabricator via cfe-commits
tcanens updated this revision to Diff 116490. tcanens added a comment. Also tweaked preceding comment. https://reviews.llvm.org/D38075 Files: lib/Sema/SemaExprCXX.cpp test/SemaCXX/cxx2a-pointer-to-const-ref-member.cpp Index: test/SemaCXX/cxx2a-pointer-to-const-ref-member.cpp

[PATCH] D40259: [libcxx] LWG2993: reference_wrapper conversion from T&

2017-11-20 Thread Tim Song via Phabricator via cfe-commits
tcanens added inline comments. Comment at: include/__functional_base:377 +inline _LIBCPP_INLINE_VISIBILITY +_Tp& __lvref_bind(_Tp& r) _NOEXCEPT { return r; } + I'd make these member functions of a class template, to avoid having to reason about partial ordering

[PATCH] D40144: Implement `std::launder`

2017-11-20 Thread Tim Song via Phabricator via cfe-commits
tcanens added inline comments. Comment at: include/new:260 +static_assert (!is_function<_Tp>::value, "can't launder functions" ); +static_assert (!is_same_v>, "can't launder cv-void" ); +#ifdef _LIBCPP_COMPILER_HAS_BUILTIN_LAUNDER

[PATCH] D40259: [libcxx] LWG2993: reference_wrapper conversion from T&

2017-11-20 Thread Tim Song via Phabricator via cfe-commits
tcanens added inline comments. Comment at: include/__functional_base:396 +!is_same<__uncvref_t<_Up>, reference_wrapper>::value +>::type, bool _IsNothrow = noexcept(__bind(_VSTD::declval<_Up>()))> +_LIBCPP_INLINE_VISIBILITY reference_wrapper(_Up&& __u)

[PATCH] D40259: [libcxx] LWG2993: reference_wrapper conversion from T&

2017-11-21 Thread Tim Song via Phabricator via cfe-commits
tcanens added inline comments. Comment at: include/__functional_base:396 +!is_same<__uncvref_t<_Up>, reference_wrapper>::value +>::type, bool _IsNothrow = noexcept(__bind(_VSTD::declval<_Up>()))> +_LIBCPP_INLINE_VISIBILITY reference_wrapper(_Up&& __u)

[PATCH] D40144: Implement `std::launder`

2017-11-16 Thread Tim Song via Phabricator via cfe-commits
tcanens added a comment. At least for GCC, it should use `__builtin_launder`. Also needs to implement "The program is ill-formed if `T` is a function type or //cv// `void`." https://reviews.llvm.org/D40144 ___ cfe-commits mailing list

[PATCH] D43773: Implement the container bits of P0805R1

2018-02-26 Thread Tim Song via Phabricator via cfe-commits
tcanens added a comment. Hmm, for `vector` and `deque`, we define a temporary variable, check that sizes match and then use range-and-a-half `equal`: const typename vector<_Tp1, _Allocator1>::size_type __sz = __x.size(); return __sz == __y.size() && _VSTD::equal(__x.begin(), __x.end(),

[PATCH] D38075: Fix PR34668 - P0704R1 implementation is too permissive

2018-07-13 Thread Tim Song via Phabricator via cfe-commits
tcanens added a comment. In https://reviews.llvm.org/D38075#1161325, @Rakete wrote: > Do you need someone to commit it? Yes, please. https://reviews.llvm.org/D38075 ___ cfe-commits mailing list cfe-commits@lists.llvm.org

[PATCH] D48616: Implement LWG 2946, 3075 and 3076

2018-06-28 Thread Tim Song via Phabricator via cfe-commits
tcanens added inline comments. Comment at: include/string:856 +_LIBCPP_METHOD_TEMPLATE_IMPLICIT_INSTANTIATION_VIS +explicit basic_string(const _Tp& __t, const allocator_type& __a); + ldionne wrote: > I think this `explicit` shouldn't be there,