[Bug c++/100022] Parameter packs not expanded with alignas specifier

2021-04-10 Thread hewillk at gmail dot com via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=100022 --- Comment #1 from 康桓瑋 --- I think this is a dup of PR 16, correct me if i am wrong.

[Bug c++/100030] New: ICE: in dependent_type_p, at cp/pt.c:26757

2021-04-11 Thread hewillk at gmail dot com via Gcc-bugs
++ Assignee: unassigned at gcc dot gnu.org Reporter: hewillk at gmail dot com Target Milestone: --- https://godbolt.org/z/G3a6Wq5e3 template auto f(Ts...) { [] { struct alignas(Ts) S {}; }; } int main() { f(0); } :3:23: internal compiler error: in dependent_type_p, at cp

[Bug c++/100030] ICE: in dependent_type_p, at cp/pt.c:26757

2021-04-11 Thread hewillk at gmail dot com via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=100030 --- Comment #1 from 康桓瑋 --- Related to RP 16.

[Bug c++/100031] New: ICE: in dependent_type_p, at cp/pt.c:26757

2021-04-11 Thread hewillk at gmail dot com via Gcc-bugs
++ Assignee: unassigned at gcc dot gnu.org Reporter: hewillk at gmail dot com Target Milestone: --- Related to PR 16, PR 100030. https://godbolt.org/z/TxGMsEv6W template auto f(Ts...) { []() requires (sizeof(Ts) == 0) {}; } int main() { f(0); } :3:18: internal

[Bug c++/100035] New: Parameter packs not expanded with local variable in lambda

2021-04-11 Thread hewillk at gmail dot com via Gcc-bugs
Priority: P3 Component: c++ Assignee: unassigned at gcc dot gnu.org Reporter: hewillk at gmail dot com Target Milestone: --- https://godbolt.org/z/ss9bjYvc1 template auto f(Ts...) { ([] { Ts x = 0; }, ...); } gcc rejects with: : In function 'auto f(Ts ...)&#

[Bug libstdc++/100044] New: ranges::subrange CTAD for __iterator_sentinel_pair not work

2021-04-12 Thread hewillk at gmail dot com via Gcc-bugs
Priority: P3 Component: libstdc++ Assignee: unassigned at gcc dot gnu.org Reporter: hewillk at gmail dot com Target Milestone: --- libstdc++ defines the CATD of __iterator_sentinel_pair for the subranges in ranges_util.h#L355: 355 template<__det

[Bug libstdc++/100044] ranges::subrange CTAD for __iterator_sentinel_pair not work

2021-04-12 Thread hewillk at gmail dot com via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=100044 --- Comment #1 from 康桓瑋 --- The problem seems to be forgetting to delete this CATD in commit 77f5310f0205714538668b88fbf1de44f1f435be.

[Bug libstdc++/100044] ranges::subrange CTAD for __iterator_sentinel_pair not work

2021-04-12 Thread hewillk at gmail dot com via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=100044 --- Comment #3 from 康桓瑋 --- Never knew the existence of this to-do list, thank you for letting me know.

[Bug c++/100084] using enum lookup isn't type-only

2021-04-14 Thread hewillk at gmail dot com via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=100084 康桓瑋 changed: What|Removed |Added CC||hewillk at gmail dot com --- Comment #3 from 康桓瑋

[Bug c++/100104] New: std::transform is 1.5 times faster than std::copy with -O3

2021-04-15 Thread hewillk at gmail dot com via Gcc-bugs
Priority: P3 Component: c++ Assignee: unassigned at gcc dot gnu.org Reporter: hewillk at gmail dot com Target Milestone: --- Consider: std::vector v1(100, 0); // copy using copy std::vector v2; std::copy(v1.begin(), v1.end(), std::back_inserter(v2)); // copy using

[Bug middle-end/100104] std::transform is 1.5 times faster than std::copy with -O3

2021-04-15 Thread hewillk at gmail dot com via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=100104 --- Comment #2 from 康桓瑋 --- Build "copy" with -O2 on x86-64 (https://godbolt.org/z/Gja6xrq9G): .LC0: .string "vector::_M_realloc_insert" copy(std::vector > const&): pushr15 pxorxmm0, xmm0 pushr14

[Bug middle-end/100104] std::transform is 1.5 times faster than std::copy with -O3

2021-04-15 Thread hewillk at gmail dot com via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=100104 --- Comment #3 from 康桓瑋 --- Build "copy" with -O2 on x86-64 (https://godbolt.org/z/Gja6xrq9G): .LC0: .string "vector::_M_realloc_insert" copy(std::vector > const&): pushr15 pxorxmm0, xmm0 pushr14

[Bug middle-end/100104] std::transform is 1.5 times faster than std::copy with -O3

2021-04-15 Thread hewillk at gmail dot com via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=100104 --- Comment #4 from 康桓瑋 --- And Build "copy" with -O2 on ARM64 is identical with -O3 (https://godbolt.org/z/5hjKGbrTd): .LC0: .string "vector::_M_realloc_insert" transform(std::vector > const&): stp x29, x30, [sp, -64]!

[Bug c++/100109] New: ICE: unexpected expression 'E' of kind template_parm_index

2021-04-15 Thread hewillk at gmail dot com via Gcc-bugs
ty: normal Priority: P3 Component: c++ Assignee: unassigned at gcc dot gnu.org Reporter: hewillk at gmail dot com Target Milestone: --- https://godbolt.org/z/Go1W7YrYs template void f() { [] { enum e { e = E }; }; } template void f<>(); :3:13: interna

[Bug c++/99809] ICE: sorry, unimplemented: unexpected AST of kind nontype_argument_pack

2021-04-16 Thread hewillk at gmail dot com via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=99809 --- Comment #4 from 康桓瑋 --- Hey, the following code (a small variation with PR 100109) triggers the same ICE in cp/constexpr.c:8889 on gcc 8-11, so maybe this is a regression bug? template void f(Ts... args) { [=]{ enum { x = [=]{ args; }

[Bug libstdc++/100133] New: std::copy extremely slow for random access iterator

2021-04-18 Thread hewillk at gmail dot com via Gcc-bugs
Component: libstdc++ Assignee: unassigned at gcc dot gnu.org Reporter: hewillk at gmail dot com Target Milestone: --- HI, I found that libstdc++‘s std::copy is extremely slow for random access iterator. For the following example, if libc++'s std::copy is used, copy from std::v

[Bug libstdc++/100133] std::copy extremely slow for random access iterator

2021-04-18 Thread hewillk at gmail dot com via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=100133 --- Comment #1 from 康桓瑋 --- And the libstdc++‘s std::copy is also 8.9 times slower than the equivalent std::tranfrom: #include #include #include const std::vector v(100, 42); static void copy_from_vector(benchmark::State& state) { for (a

[Bug libstdc++/100133] std::copy extremely slow for random access iterator

2021-04-18 Thread hewillk at gmail dot com via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=100133 --- Comment #2 from 康桓瑋 --- After actually executing the same code on my local and remote servers, I did not produce such a result. In both cases, std::copy achieved the expected high-efficiency performance, so I think this should only be Quick

[Bug libstdc++/100133] std::copy extremely slow for random access iterator

2021-04-18 Thread hewillk at gmail dot com via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=100133 康桓瑋 changed: What|Removed |Added Status|UNCONFIRMED |RESOLVED Resolution|---

[Bug middle-end/100104] std::transform is 1.5 times faster than std::copy with -O3

2021-04-18 Thread hewillk at gmail dot com via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=100104 康桓瑋 changed: What|Removed |Added Resolution|--- |INVALID Status|UNCONFIRMED

[Bug libstdc++/100153] New: Undefined behavior in stl_bvector.h

2021-04-20 Thread hewillk at gmail dot com via Gcc-bugs
++ Assignee: unassigned at gcc dot gnu.org Reporter: hewillk at gmail dot com Target Milestone: --- stl_bvector.h#L505: _Bit_type* _M_end_addr() const _GLIBCXX_NOEXCEPT { if (this->_M_end_of_storage) return std::__addressof(this->_M_end_of_storage[-1

[Bug c++/100172] New: ICE with "concept concept" keyword in struct

2021-04-20 Thread hewillk at gmail dot com via Gcc-bugs
mponent: c++ Assignee: unassigned at gcc dot gnu.org Reporter: hewillk at gmail dot com Target Milestone: --- The following only shows a warning, which may be related to fixed PR97536. struct { concept concept; }; :2:3: warning: C++20 concept definition syntax is 'con

[Bug c++/100172] ICE with "concept concept" keyword in struct

2021-04-20 Thread hewillk at gmail dot com via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=100172 --- Comment #1 from 康桓瑋 --- And gcc-trunk accepts this non-sense snippet: https://godbolt.org/z/PbTa55eTx void f(auto) { struct S { concept enum E {}; }; []() requires S::E {}; } template void f(int);

[Bug c++/100172] ICE with "concept concept" keyword in struct

2021-04-20 Thread hewillk at gmail dot com via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=100172 --- Comment #2 from 康桓瑋 --- The struct bit is a red herring. It can be boiled down to just two concept keywords: https://godbolt.org/z/sW7vr3sso concept concept; :1:1: warning: C++20 concept definition syntax is 'concept = ' 1 | concept

[Bug libstdc++/100187] New: ranges::search_n helper lambda misses forwarding return type

2021-04-21 Thread hewillk at gmail dot com via Gcc-bugs
Priority: P3 Component: libstdc++ Assignee: unassigned at gcc dot gnu.org Reporter: hewillk at gmail dot com Target Milestone: --- ranges_algo.h#L565: auto __value_comp = [&] (_Rp&& __arg) { return std::__invoke(__pred, std::forward<_Rp&g

[Bug libstdc++/100187] ranges::search_n helper lambda misses forwarding return type

2021-04-21 Thread hewillk at gmail dot com via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=100187 --- Comment #1 from 康桓瑋 --- Same with is_permutation helper lambda __comp_scan in ranges_algo.h#L807: auto __comp_scan = [&] (_Tp&& __arg) { return std::__invoke(__pred, __proj_scan, std::forward<_Tp>(__arg)); };

[Bug libstdc++/100187] ranges::search_n helper lambda misses forwarding return type

2021-04-21 Thread hewillk at gmail dot com via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=100187 --- Comment #2 from 康桓瑋 --- Or more consistent, just -> bool.

[Bug libstdc++/100187] ranges::search_n helper lambda misses forwarding return type

2021-04-21 Thread hewillk at gmail dot com via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=100187 --- Comment #3 from 康桓瑋 --- Hey, the __remove_fn helper lambda __pred in ranges_algo.h#L1259 also has this issue, we need to forward the return type of the operator==. You can see https://godbolt.org/z/ro34WYGnW for the failure case, thanks.

[Bug c++/100198] New: ICE: unexpected expression 'E' of kind template_parm_index

2021-04-22 Thread hewillk at gmail dot com via Gcc-bugs
ty: normal Priority: P3 Component: c++ Assignee: unassigned at gcc dot gnu.org Reporter: hewillk at gmail dot com Target Milestone: --- 12 Regression extremely related to fixed PR 100109. template void f() { ([] { enum e { e = E }; }(), ...); } template void f<

[Bug c++/100198] ICE: unexpected expression 'E' of kind template_parm_index

2021-04-22 Thread hewillk at gmail dot com via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=100198 --- Comment #2 from 康桓瑋 --- (In reply to Richard Biener from comment #1) > would be nice if you'd hinted on whether you think your testcases are valid > C++ or not. guessing invalid here Oops, I should do that, this is a valid code. https://g

[Bug c++/100055] [10/11/12 Regression] ICE on invalid requires expression

2021-04-22 Thread hewillk at gmail dot com via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=100055 康桓瑋 changed: What|Removed |Added CC||hewillk at gmail dot com --- Comment #3 from 康桓瑋

[Bug libstdc++/100223] New: Missing early return in std::partial_sort

2021-04-22 Thread hewillk at gmail dot com via Gcc-bugs
: libstdc++ Assignee: unassigned at gcc dot gnu.org Reporter: hewillk at gmail dot com Target Milestone: --- Hi, can we add an early return to std::partial_sort to avoid unnecessary O(n) operations when __first is equal to __middle, just like std::rotate does, and make the result

[Bug libstdc++/100223] Missing early return in std::partial_sort

2021-04-23 Thread hewillk at gmail dot com via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=100223 --- Comment #2 from 康桓瑋 --- (In reply to Jonathan Wakely from comment #1) > Arguably, the caller can do this check if they think it can occur in their > code. That way all calls to the algorithm don't pay for the check. > > But it's probably ch

[Bug libstdc++/100237] New: Unnecessary std::move in ranges::min, ranges::max and ranges::minmax

2021-04-23 Thread hewillk at gmail dot com via Gcc-bugs
Priority: P3 Component: libstdc++ Assignee: unassigned at gcc dot gnu.org Reporter: hewillk at gmail dot com Target Milestone: --- Hey, in ranges_algo.h#L3121: constexpr const _Tp& operator()(const _Tp& __a, const _Tp& __b,

[Bug c++/100248] New: ICE with global "default" keyword

2021-04-24 Thread hewillk at gmail dot com via Gcc-bugs
mponent: c++ Assignee: unassigned at gcc dot gnu.org Reporter: hewillk at gmail dot com Target Milestone: --- 10.2, 10.3, 11 and 12 regression: https://godbolt.org/z/qrvE98Taa #include struct S {}; auto operator<=>(S&&, S&&) = default; :4:30: internal compiler

[Bug libstdc++/100249] New: missing forwarding std::__invoke result in ranges::is_permutation and ranges::clamp

2021-04-24 Thread hewillk at gmail dot com via Gcc-bugs
Severity: normal Priority: P3 Component: libstdc++ Assignee: unassigned at gcc dot gnu.org Reporter: hewillk at gmail dot com Target Milestone: --- Hey, in ranges::is_permutation in ranges_algo.h#L808: auto __proj_scan = std::__invoke(__proj1, *__scan

[Bug libstdc++/100249] missing forwarding std::__invoke result in ranges::is_permutation and ranges::clamp

2021-04-24 Thread hewillk at gmail dot com via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=100249 --- Comment #1 from 康桓瑋 --- (In reply to 康桓瑋 from comment #0) > when the type of __proj_val is an rvalue reference, we need to convert it to > rvalue for the next std::__invoke call: https://godbolt.org/z/1G7aqxs3c. More simple case: https://g

[Bug libstdc++/97512] New: Move std::ranges::subrange structured bindings stuff from to

2020-10-21 Thread hewillk at gmail dot com via Gcc-bugs
Priority: P3 Component: libstdc++ Assignee: unassigned at gcc dot gnu.org Reporter: hewillk at gmail dot com Target Milestone: --- In commit 160061a: libstdc++: Introduce new headers for C++20 ranges components, structured bindings stuff of std::ranges::subrange is

[Bug c++/96410] A lambda with a template parameter list inside the template function using C++20 requires clauses is not usable in a constant expression

2020-10-22 Thread hewillk at gmail dot com via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=96410 康桓瑋 changed: What|Removed |Added Status|ASSIGNED|RESOLVED Resolution|---

[Bug c++/96409] A lambda with a template parameter list inside the template function using C++20 nested requirements clauses occurs internal compiler error

2020-10-22 Thread hewillk at gmail dot com via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=96409 康桓瑋 changed: What|Removed |Added Resolution|--- |FIXED Status|ASSIGNED

[Bug c++/96499] Pass ill-formed visitor with different return type of result type of 3-way comparison into std::visit occurs internal compiler error

2020-10-22 Thread hewillk at gmail dot com via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=96499 康桓瑋 changed: What|Removed |Added Resolution|--- |FIXED Status|UNCONFIRMED

[Bug c++/100248] ICE with global "default" keyword

2021-04-25 Thread hewillk at gmail dot com via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=100248 --- Comment #1 from 康桓瑋 --- Reduced to no header: struct S {}; bool operator==(S&&, S&&) = default; :2:29: internal compiler error: Segmentation fault 2 | bool operator==(S&&, S&&) = default; | ^~~ 0x1

[Bug libstdc++/100287] New: Using iterator after std::move in ranges::partition

2021-04-27 Thread hewillk at gmail dot com via Gcc-bugs
Component: libstdc++ Assignee: unassigned at gcc dot gnu.org Reporter: hewillk at gmail dot com Target Milestone: --- Hi, in ranges::partition in ranges_algo.h#L2540: if (__first == __last) return {std::move(__first), std::move(__first)}; while (std::__invoke(__pred, std

[Bug libstdc++/100249] missing forwarding std::__invoke result in ranges::is_permutation and ranges::clamp

2021-04-27 Thread hewillk at gmail dot com via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=100249 --- Comment #5 from 康桓瑋 --- (In reply to Patrick Palka from comment #4) > (In reply to 康桓瑋 from comment #0) > > when the type of __proj_val is an rvalue reference, we need to convert it to > > rvalue for the next std::__invoke call: https://godb

[Bug libstdc++/100387] New: ranges::minmax compares moved-out value

2021-05-02 Thread hewillk at gmail dot com via Gcc-bugs
++ Assignee: unassigned at gcc dot gnu.org Reporter: hewillk at gmail dot com Target Milestone: --- In ranges_algo.h#L3301: if (std::__invoke(__comp, std::__invoke(__proj, __tmp), std::__invoke(__proj, __result.min))) __result.min

[Bug libstdc++/100387] ranges::minmax compares moved-out value

2021-05-02 Thread hewillk at gmail dot com via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=100387 --- Comment #1 from 康桓瑋 --- Also, in std::shift_right: std::move(std::move(__first), std::move(__dest_head), std::move(__result)); return __result; we return the moved-out __result.

[Bug libstdc++/100436] New: std::views::iota(0, true) is well-formed

2021-05-05 Thread hewillk at gmail dot com via Gcc-bugs
: libstdc++ Assignee: unassigned at gcc dot gnu.org Reporter: hewillk at gmail dot com Target Milestone: --- Hi, The following is accepted since gcc-11: https://godbolt.org/z/P8v383Wr3 #include auto r = std::views::iota(0, true); Shouldn't this be ill-formed? Isn’t this ki

[Bug libstdc++/100436] std::views::iota(0, true) is well-formed

2021-05-05 Thread hewillk at gmail dot com via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=100436 --- Comment #1 from 康桓瑋 --- Oh, I see, the reason is that std::ranges::__detail::__is_integer_like is set to false since gcc-11.

[Bug libstdc++/100436] std::views::iota(0, true) is well-formed

2021-05-05 Thread hewillk at gmail dot com via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=100436 康桓瑋 changed: What|Removed |Added Resolution|--- |INVALID Status|UNCONFIRMED

[Bug libstdc++/100436] std::views::iota(0, true) is well-formed

2021-05-05 Thread hewillk at gmail dot com via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=100436 --- Comment #3 from 康桓瑋 --- (In reply to 康桓瑋 from comment #2) > (In reply to 康桓瑋 from comment #1) > > Oh, I see, the reason is that std::ranges::__detail::__is_integer_like > > is set to false since gcc-11. > > This is just the implementation o

[Bug c++/100474] New: ICE: in diagnose_trait_expr, at cp/constraint.cc:3706

2021-05-07 Thread hewillk at gmail dot com via Gcc-bugs
Component: c++ Assignee: unassigned at gcc dot gnu.org Reporter: hewillk at gmail dot com Target Milestone: --- This is a very tough one that is extremely difficult to reduce, but I will try. https://godbolt.org/z/69GsTKrxe #include struct S { S(auto, auto...); }; ranges

[Bug libstdc++/100475] New: semiregular-box's constructor uses wrong list-initialization

2021-05-07 Thread hewillk at gmail dot com via Gcc-bugs
ormal Priority: P3 Component: libstdc++ Assignee: unassigned at gcc dot gnu.org Reporter: hewillk at gmail dot com Target Milestone: --- The specialization of semiregular-box's constructor in ranges#L166: template requires constructible_from<_Tp, _Args...

[Bug libstdc++/100475] semiregular-box's constructor uses wrong list-initialization

2021-05-07 Thread hewillk at gmail dot com via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=100475 --- Comment #2 from 康桓瑋 --- Reduced example: #include struct S { S() = default; S(int, int) {} S(std::initializer_list) = delete; }; std::ranges::single_view single(std::in_place, 0, 0); https://godbolt.org/z/d1bE8sPdd

[Bug libstdc++/100475] semiregular-box's constructor uses wrong list-initialization

2021-05-07 Thread hewillk at gmail dot com via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=100475 --- Comment #3 from 康桓瑋 --- Also, the operator->() simply uses operator& instead of std::__addressof. https://godbolt.org/z/zfGnEoePG

[Bug libstdc++/100475] semiregular-box's constructor uses wrong list-initialization

2021-05-07 Thread hewillk at gmail dot com via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=100475 --- Comment #4 from 康桓瑋 --- (In reply to 康桓瑋 from comment #3) > Also, the operator->() simply uses operator& instead of std::__addressof. > > https://godbolt.org/z/zfGnEoePG Another issue is that the has_value() of this specialization will alw

[Bug libstdc++/100249] missing forwarding std::__invoke result in ranges::is_permutation and ranges::clamp

2021-05-07 Thread hewillk at gmail dot com via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=100249 --- Comment #8 from 康桓瑋 --- (In reply to Patrick Palka from comment #6) > > Maybe this can help: > > > > auto&& __proj_val = std::__invoke(__proj, __val); > > if (std::__invoke(__comp, > > std::forward(__proj_val), std::__invoke(__proj,

[Bug libstdc++/100567] New: views::take and views::drop should conditionally use _RangeAdaptor::operator()

2021-05-12 Thread hewillk at gmail dot com via Gcc-bugs
: normal Priority: P3 Component: libstdc++ Assignee: unassigned at gcc dot gnu.org Reporter: hewillk at gmail dot com Target Milestone: --- Hi, the re-implemented range adaptors use _RangeAdaptor to handle the arg of the adaptors, but for views::take and

[Bug libstdc++/100558] std::ranges::views operator| fails to compile

2021-05-12 Thread hewillk at gmail dot com via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=100558 康桓瑋 changed: What|Removed |Added CC||hewillk at gmail dot com --- Comment #1 from 康桓瑋

[Bug libstdc++/100567] views::take and views::drop should conditionally use _RangeAdaptor::operator()

2021-05-12 Thread hewillk at gmail dot com via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=100567 康桓瑋 changed: What|Removed |Added Resolution|--- |INVALID Status|UNCONFIRMED

[Bug libstdc++/100606] New: Please complete LWG3490: ranges::drop_while_view::begin() is missing a precondition.

2021-05-14 Thread hewillk at gmail dot com via Gcc-bugs
: UNCONFIRMED Severity: normal Priority: P3 Component: libstdc++ Assignee: unassigned at gcc dot gnu.org Reporter: hewillk at gmail dot com Target Milestone: --- Hi, libstdc++ has not yet completed LWG3490 which is very simple and only needs to add an

[Bug libstdc++/100621] New: ranges::reverse_view fails to meet its complexity requirements

2021-05-15 Thread hewillk at gmail dot com via Gcc-bugs
Priority: P3 Component: libstdc++ Assignee: unassigned at gcc dot gnu.org Reporter: hewillk at gmail dot com Target Milestone: --- Hi, in ranges#L3230, the _S_needs_cached_begin of reverse_view is defined as: static constexpr bool _S_needs_cached_begin

[Bug libstdc++/100631] New: ranges::elements_view:: _Sentinel is missing __distance_from() that can access _M_current of _Iterator

2021-05-16 Thread hewillk at gmail dot com via Gcc-bugs
Status: UNCONFIRMED Severity: normal Priority: P3 Component: libstdc++ Assignee: unassigned at gcc dot gnu.org Reporter: hewillk at gmail dot com Target Milestone: --- We should add a __distance_from() to elements_view::_Sentinel just like

[Bug libstdc++/100631] ranges::elements_view:: _Sentinel is missing __distance_from() that can access _M_current of _Iterator

2021-05-16 Thread hewillk at gmail dot com via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=100631 --- Comment #1 from 康桓瑋 --- Another issue is that in elements_view::_Sentinel in ranges#L3677: template> requires sized_sentinel_for, iterator_t<_Base2>> friend constexpr range_difference_t<_Base2> operator-(const _Iterator<_Cons

[Bug libstdc++/100631] ranges::elements_view:: _Sentinel is missing __distance_from() that can access _M_current of _Iterator

2021-05-16 Thread hewillk at gmail dot com via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=100631 --- Comment #2 from 康桓瑋 --- In addition, I think elements_view::_Sentinel::_M_equal should be a template function, and elements_view::_Iterator also needs to declare _Sentinel as a friend, otherwise the following valid codes will be rejected: h

[Bug libstdc++/100631] ranges::elements_view:: _Sentinel is missing __distance_from() that can access _M_current of _Iterator

2021-05-17 Thread hewillk at gmail dot com via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=100631 --- Comment #5 from 康桓瑋 --- (In reply to TC from comment #4) > This one is a problem with the WP. Thanks, Tim, does it have an LWG number?

[Bug libstdc++/100631] ranges::elements_view:: _Sentinel is missing __distance_from() that can access _M_current of _Iterator

2021-05-17 Thread hewillk at gmail dot com via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=100631 --- Comment #7 from 康桓瑋 --- (In reply to CVS Commits from comment #6) > The master branch has been updated by Patrick Palka : > > https://gcc.gnu.org/g:2e2eef80ac0c21f9533e6791ccf5e29458cbb77c > > commit r12-854-g2e2eef80ac0c21f9533e6791ccf5e2

[Bug libstdc++/100664] New: ranges::drop_view fails to meet its complexity requirements

2021-05-18 Thread hewillk at gmail dot com via Gcc-bugs
Priority: P3 Component: libstdc++ Assignee: unassigned at gcc dot gnu.org Reporter: hewillk at gmail dot com Target Milestone: --- Hi, in ranges#L2043, the _S_needs_cached_begin of reverse_view is defined as: static constexpr bool _S_needs_cached_begin

[Bug libstdc++/100664] ranges::drop_view fails to meet its complexity requirements

2021-05-18 Thread hewillk at gmail dot com via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=100664 --- Comment #1 from 康桓瑋 --- (In reply to 康桓瑋 from comment #0) > Hi, in ranges#L2043, the _S_needs_cached_begin of reverse_view is defined as: This is drop_view, sorry for the typo.

[Bug c++/100675] New: std::string_view::find in constexpr function is not constant expression

2021-05-19 Thread hewillk at gmail dot com via Gcc-bugs
: normal Priority: P3 Component: c++ Assignee: unassigned at gcc dot gnu.org Reporter: hewillk at gmail dot com Target Milestone: --- The following code fails in 10.1, 10.2, and 10.3: https://godbolt.org/z/soGT9o4GY #include template constexpr bool g

[Bug c++/100675] std::string_view::find in constexpr function is not constant expression

2021-05-19 Thread hewillk at gmail dot com via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=100675 --- Comment #1 from 康桓瑋 --- (In reply to 康桓瑋 from comment #0) > The following code fails in 10.1, 10.2, and 10.3: > > https://godbolt.org/z/soGT9o4GY > > #include > > template > constexpr bool g() { > std::string_view s = " "; > s.find(

[Bug libstdc++/100690] New: ranges::iota_view::_Sentinel cannot access _M_current of _Iterator

2021-05-19 Thread hewillk at gmail dot com via Gcc-bugs
Priority: P3 Component: libstdc++ Assignee: unassigned at gcc dot gnu.org Reporter: hewillk at gmail dot com Target Milestone: --- Same access issue as PR100631: https://godbolt.org/z/z4Ysc1cez #include int main() { int x[] = {42, 42, 42}; auto r = std

[Bug libstdc++/100664] ranges::drop_view fails to meet its complexity requirements

2021-05-22 Thread hewillk at gmail dot com via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=100664 --- Comment #2 from 康桓瑋 --- (In reply to 康桓瑋 from comment #0) > Hi, in ranges#L2043, the _S_needs_cached_begin of reverse_view is defined as: > > >static constexpr bool _S_needs_cached_begin > = !(random_access_range && sized_range);

[Bug libstdc++/100770] New: Incorrect if constexpr statement in ranges::unique_copy

2021-05-26 Thread hewillk at gmail dot com via Gcc-bugs
Priority: P3 Component: libstdc++ Assignee: unassigned at gcc dot gnu.org Reporter: hewillk at gmail dot com Target Milestone: --- In ranges::unique_copy in ranges_algo.h#L1435: else if constexpr (input_iterator<_Out> && same_as, ite

[Bug libstdc++/100795] New: ranges::sample should not use std::sample directly

2021-05-27 Thread hewillk at gmail dot com via Gcc-bugs
Component: libstdc++ Assignee: unassigned at gcc dot gnu.org Reporter: hewillk at gmail dot com Target Milestone: --- Since some random access ranges are only input ranges in C++17, this will cause ranges::sample to incorrectly reject the following valid case: #include #include

[Bug libstdc++/100795] ranges::sample should not use std::sample directly

2021-05-27 Thread hewillk at gmail dot com via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=100795 --- Comment #2 from 康桓瑋 --- ranges::inplace_merge has the same issue: #include #include #include int main() { std::array a{42, 42, 42}; auto r = std::views::iota(0, 3) | std::views::transform([&a](int i) -> int& { return a[

[Bug libstdc++/100795] ranges::sample should not use std::sample directly

2021-05-27 Thread hewillk at gmail dot com via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=100795 --- Comment #3 from 康桓瑋 --- (In reply to 康桓瑋 from comment #2) > ranges::inplace_merge has the same issue: > > > #include > #include > #include > > int main() { > std::array a{42, 42, 42}; > auto r = std::views::iota(0, 3) | >

[Bug libstdc++/100795] ranges::sample should not use std::sample directly

2021-05-27 Thread hewillk at gmail dot com via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=100795 --- Comment #4 from 康桓瑋 --- Same with ranges::make_heap, ranges::push_heap, ranges::pop_heap, and ranges::sort_heap when _GLIBCXX_CONCEPT_CHECKS is defined.

[Bug libstdc++/100795] ranges::sample should not use std::sample directly

2021-05-27 Thread hewillk at gmail dot com via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=100795 --- Comment #5 from 康桓瑋 --- (In reply to 康桓瑋 from comment #4) > Same with ranges::make_heap, ranges::push_heap, ranges::pop_heap, and > ranges::sort_heap when _GLIBCXX_CONCEPT_CHECKS is defined. And std::ranges::shuffle.

[Bug libstdc++/100824] New: ranges::size should treat the subexpression as an lvalue

2021-05-29 Thread hewillk at gmail dot com via Gcc-bugs
Priority: P3 Component: libstdc++ Assignee: unassigned at gcc dot gnu.org Reporter: hewillk at gmail dot com Target Milestone: --- The CPO described in [range.access] treats the subexpression E as an lvalue, but ranges::size, ranges::empty, and ranges::data forward E

[Bug libstdc++/100833] New: ranges::advance should return n when i == bound

2021-05-30 Thread hewillk at gmail dot com via Gcc-bugs
: libstdc++ Assignee: unassigned at gcc dot gnu.org Reporter: hewillk at gmail dot com Target Milestone: --- This is specified in [range.iter.op.advance#7]: "Returns: n - M, where M is the difference between the ending and starting positions of i." #include cons

[Bug libstdc++/100894] New: The std::common_reference implementation seems to be wrong

2021-06-03 Thread hewillk at gmail dot com via Gcc-bugs
Priority: P3 Component: libstdc++ Assignee: unassigned at gcc dot gnu.org Reporter: hewillk at gmail dot com Target Milestone: --- In [meta#trans.other-6.3.1], the standard specifies "If T1 and T2 are reference types and COMMON-REF(T1, T2) is well-formed, the

[Bug c++/100895] New: gcc accepts invalid template argument in partial template specialization

2021-06-03 Thread hewillk at gmail dot com via Gcc-bugs
: normal Priority: P3 Component: c++ Assignee: unassigned at gcc dot gnu.org Reporter: hewillk at gmail dot com Target Milestone: --- template using type = int; template constexpr bool value = true; template struct S {}; template struct S>> {}

[Bug libstdc++/100900] error: missing 'typename' prior to dependent type name in elements_view

2021-06-04 Thread hewillk at gmail dot com via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=100900 康桓瑋 changed: What|Removed |Added CC||hewillk at gmail dot com --- Comment #1 from 康桓瑋

[Bug libstdc++/100824] ranges::size should treat the subexpression as an lvalue

2021-06-04 Thread hewillk at gmail dot com via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=100824 --- Comment #3 from 康桓瑋 --- Another trivial issue is that LWG 3403 is not implemented and the ranges​::​data is missing the decay-copy part, making it unable to work with the following type. struct A { int*&& data(); };

[Bug libstdc++/100824] ranges::size should treat the subexpression as an lvalue

2021-06-04 Thread hewillk at gmail dot com via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=100824 --- Comment #7 from 康桓瑋 --- (In reply to Jonathan Wakely from comment #6) > And LWG 3403 was fixed by r12-1228. Hey, Jonathan, thank you for your contribution to gcc. Regarding the implementation of LWG 3403, the return type of __int128 is unsi

[Bug libstdc++/100475] semiregular-box's constructor uses wrong list-initialization

2021-06-06 Thread hewillk at gmail dot com via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=100475 --- Comment #7 from 康桓瑋 --- (In reply to CVS Commits from comment #6) > The master branch has been updated by Patrick Palka : > > https://gcc.gnu.org/g:fe993b469c528230d9a01e1ae2208610f960dd9f > > commit r12-856-gfe993b469c528230d9a01e1ae22086

[Bug libstdc++/100940] New: views::take and views::drop should not define _S_has_simple_extra_args

2021-06-06 Thread hewillk at gmail dot com via Gcc-bugs
Priority: P3 Component: libstdc++ Assignee: unassigned at gcc dot gnu.org Reporter: hewillk at gmail dot com Target Milestone: --- For view::take and views::drop, we need to perfectly forward its incoming arg in some uncommon situations: #include struct

[Bug libstdc++/100940] views::take and views::drop should not define _S_has_simple_extra_args

2021-06-07 Thread hewillk at gmail dot com via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=100940 --- Comment #1 from 康桓瑋 --- It seems that before r12-1184, the solution to PR100577 can be simply to remove const && delete operator(). The reason is that const & and && overloads themselves are constrained, and if _Rhs meets __pipe_invocable, i

[Bug libstdc++/100940] views::take and views::drop should not define _S_has_simple_extra_args

2021-06-07 Thread hewillk at gmail dot com via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=100940 --- Comment #2 from 康桓瑋 --- (In reply to 康桓瑋 from comment #1) > It seems that before r12-1184, the solution to PR100577 can be simply to > remove const && delete operator(). The reason is that const & and && > overloads themselves are constraine

[Bug libstdc++/100982] New: wrong constraint in std::optional::operator=

2021-06-08 Thread hewillk at gmail dot com via Gcc-bugs
: libstdc++ Assignee: unassigned at gcc dot gnu.org Reporter: hewillk at gmail dot com Target Milestone: --- There is a typo in optional#L818: template enable_if_t<__and_v<__not_>, is_constructible<_Tp, const _Up&>, is_a

[Bug c++/101033] New: Error message for spelling error in copy assignment operator could be improved

2021-06-11 Thread hewillk at gmail dot com via Gcc-bugs
: normal Priority: P3 Component: c++ Assignee: unassigned at gcc dot gnu.org Reporter: hewillk at gmail dot com Target Milestone: --- Consider the following: https://godbolt.org/z/vfdTq9j3x class S { S& operator=(cont S&); }; There is a spelli

[Bug libstdc++/101034] New: wrong constraint in std::any's constructor

2021-06-11 Thread hewillk at gmail dot com via Gcc-bugs
onent: libstdc++ Assignee: unassigned at gcc dot gnu.org Reporter: hewillk at gmail dot com Target Milestone: --- In any#L208: template , typename _Mgr = _Manager<_VTp>, __any_constructible_t<_VTp, initializer_list<_Up>, _Args&&am

[Bug libstdc++/101034] wrong constraint in std::any's constructor

2021-06-11 Thread hewillk at gmail dot com via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=101034 --- Comment #1 from 康桓瑋 --- any#L272 has the same typo: template __emplace_t, initializer_list<_Up>, _Args&&...> emplace(initializer_list<_Up> __il, _Args&&... __args)

[Bug libstdc++/101056] New: std::compare_partial_order_fallback missing the constraint of "F < E is well-formed"

2021-06-13 Thread hewillk at gmail dot com via Gcc-bugs
: UNCONFIRMED Severity: normal Priority: P3 Component: libstdc++ Assignee: unassigned at gcc dot gnu.org Reporter: hewillk at gmail dot com Target Milestone: --- In [cmp#alg-6.3]: Otherwise, if the expressions E == F, E < F, and F < E are all well-formed

[Bug libstdc++/101056] std::compare_partial_order_fallback missing the constraint of "F < E is well-formed"

2021-06-14 Thread hewillk at gmail dot com via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=101056 --- Comment #1 from 康桓瑋 --- This is not a bug, it's just that LWG3465 has not been implemented yet.

[Bug c++/101214] New: ranges::split_view​::​sentinel lacks default constructor

2021-06-25 Thread hewillk at gmail dot com via Gcc-bugs
Priority: P3 Component: c++ Assignee: unassigned at gcc dot gnu.org Reporter: hewillk at gmail dot com Target Milestone: --- #include int main() { auto r = std::views::iota(0) | std::views::take(5); decltype(std::views::split(r, 0).end()) e{}; } https

[Bug libstdc++/101214] ranges::split_view​::​sentinel lacks default constructor

2021-06-25 Thread hewillk at gmail dot com via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=101214 --- Comment #1 from 康桓瑋 --- (In reply to 康桓瑋 from comment #0) > #include > > int main() { > auto r = std::views::iota(0) | std::views::take(5); > decltype(std::views::split(r, 0).end()) e{}; > } > Another tiny issue is that in ranges#L33

[Bug libstdc++/101231] New: _CachedPosition::_M_get() should not return {} when range adapter does not model forward_range

2021-06-27 Thread hewillk at gmail dot com via Gcc-bugs
Severity: normal Priority: P3 Component: libstdc++ Assignee: unassigned at gcc dot gnu.org Reporter: hewillk at gmail dot com Target Milestone: --- After P2325, iterators such as basic_istream_view::iterator are no longer default_initializable, so

[Bug libstdc++/101214] ranges::split_view​::​sentinel lacks default constructor

2021-06-27 Thread hewillk at gmail dot com via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=101214 --- Comment #2 from 康桓瑋 --- In ranges#L3367: _Iterator() requires default_initializable> = default; This constraint seems to be redundant because forward_iterator always satisfies default_initializable.

[Bug libstdc++/108362] New: views::istream is SFINAE-unfriendly

2023-01-10 Thread hewillk at gmail dot com via Gcc-bugs
++ Assignee: unassigned at gcc dot gnu.org Reporter: hewillk at gmail dot com Target Milestone: --- Similar issue with https://github.com/microsoft/STL/pull/3335. #include #include template concept can_istream_view = requires { std::views::istream(std::cin); }; struct S

<    1   2   3   4   5   6   >