public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c++/101233] New: ICE when using ::ranges::v3::to<std::pmr::vector>
@ 2021-06-27 15:00 475647575 at qq dot com
  2021-06-28  7:31 ` [Bug c++/101233] " marxin at gcc dot gnu.org
                   ` (9 more replies)
  0 siblings, 10 replies; 11+ messages in thread
From: 475647575 at qq dot com @ 2021-06-27 15:00 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=101233

            Bug ID: 101233
           Summary: ICE when using ::ranges::v3::to<std::pmr::vector>
           Product: gcc
           Version: 11.1.1
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c++
          Assignee: unassigned at gcc dot gnu.org
          Reporter: 475647575 at qq dot com
  Target Milestone: ---

Try the following code:
--------
#include <vector>
#include <range/v3/action.hpp>

int main(){
    std::vector<int> v{1,2,3,4,5};
    v | ::ranges::v3::to<std::pmr::vector>;
}
--------

godbolt link:https://godbolt.org/z/oxnbad9M6

^ permalink raw reply	[flat|nested] 11+ messages in thread

* [Bug c++/101233] ICE when using ::ranges::v3::to<std::pmr::vector>
  2021-06-27 15:00 [Bug c++/101233] New: ICE when using ::ranges::v3::to<std::pmr::vector> 475647575 at qq dot com
@ 2021-06-28  7:31 ` marxin at gcc dot gnu.org
  2021-06-28 10:08 ` 475647575 at qq dot com
                   ` (8 subsequent siblings)
  9 siblings, 0 replies; 11+ messages in thread
From: marxin at gcc dot gnu.org @ 2021-06-28  7:31 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=101233

Martin Liška <marxin at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
     Ever confirmed|0                           |1
   Last reconfirmed|                            |2021-06-28
                 CC|                            |marxin at gcc dot gnu.org
             Status|UNCONFIRMED                 |WAITING

--- Comment #1 from Martin Liška <marxin at gcc dot gnu.org> ---
Am I right, the code is invalid?

^ permalink raw reply	[flat|nested] 11+ messages in thread

* [Bug c++/101233] ICE when using ::ranges::v3::to<std::pmr::vector>
  2021-06-27 15:00 [Bug c++/101233] New: ICE when using ::ranges::v3::to<std::pmr::vector> 475647575 at qq dot com
  2021-06-28  7:31 ` [Bug c++/101233] " marxin at gcc dot gnu.org
@ 2021-06-28 10:08 ` 475647575 at qq dot com
  2021-06-28 10:26 ` marxin at gcc dot gnu.org
                   ` (7 subsequent siblings)
  9 siblings, 0 replies; 11+ messages in thread
From: 475647575 at qq dot com @ 2021-06-28 10:08 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=101233

--- Comment #2 from 欢乐的0403 <475647575 at qq dot com> ---
This stumps me. I don't know if the code is valid or not.
But these code compiles:
----
v | ::ranges::v3::to<std::vector>;
----
v | ::ranges::v3::to_vector;
----

So I guess the code is more likely to be valid?

^ permalink raw reply	[flat|nested] 11+ messages in thread

* [Bug c++/101233] ICE when using ::ranges::v3::to<std::pmr::vector>
  2021-06-27 15:00 [Bug c++/101233] New: ICE when using ::ranges::v3::to<std::pmr::vector> 475647575 at qq dot com
  2021-06-28  7:31 ` [Bug c++/101233] " marxin at gcc dot gnu.org
  2021-06-28 10:08 ` 475647575 at qq dot com
@ 2021-06-28 10:26 ` marxin at gcc dot gnu.org
  2021-06-28 10:34 ` 475647575 at qq dot com
                   ` (6 subsequent siblings)
  9 siblings, 0 replies; 11+ messages in thread
From: marxin at gcc dot gnu.org @ 2021-06-28 10:26 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=101233

Martin Liška <marxin at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|WAITING                     |NEW
           Keywords|                            |ice-on-valid-code
                 CC|                            |jason at gcc dot gnu.org

--- Comment #3 from Martin Liška <marxin at gcc dot gnu.org> ---
Then let's mark it as ICE on valid code.

^ permalink raw reply	[flat|nested] 11+ messages in thread

* [Bug c++/101233] ICE when using ::ranges::v3::to<std::pmr::vector>
  2021-06-27 15:00 [Bug c++/101233] New: ICE when using ::ranges::v3::to<std::pmr::vector> 475647575 at qq dot com
                   ` (2 preceding siblings ...)
  2021-06-28 10:26 ` marxin at gcc dot gnu.org
@ 2021-06-28 10:34 ` 475647575 at qq dot com
  2021-07-15 15:22 ` ppalka at gcc dot gnu.org
                   ` (5 subsequent siblings)
  9 siblings, 0 replies; 11+ messages in thread
From: 475647575 at qq dot com @ 2021-06-28 10:34 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=101233

--- Comment #4 from 欢乐的0403 <475647575 at qq dot com> ---
Good, looking forward to it being fixed.

^ permalink raw reply	[flat|nested] 11+ messages in thread

* [Bug c++/101233] ICE when using ::ranges::v3::to<std::pmr::vector>
  2021-06-27 15:00 [Bug c++/101233] New: ICE when using ::ranges::v3::to<std::pmr::vector> 475647575 at qq dot com
                   ` (3 preceding siblings ...)
  2021-06-28 10:34 ` 475647575 at qq dot com
@ 2021-07-15 15:22 ` ppalka at gcc dot gnu.org
  2021-07-15 16:00 ` ppalka at gcc dot gnu.org
                   ` (4 subsequent siblings)
  9 siblings, 0 replies; 11+ messages in thread
From: ppalka at gcc dot gnu.org @ 2021-07-15 15:22 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=101233

Patrick Palka <ppalka at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |ppalka at gcc dot gnu.org
           Assignee|unassigned at gcc dot gnu.org      |ppalka at gcc dot gnu.org
             Status|NEW                         |ASSIGNED

^ permalink raw reply	[flat|nested] 11+ messages in thread

* [Bug c++/101233] ICE when using ::ranges::v3::to<std::pmr::vector>
  2021-06-27 15:00 [Bug c++/101233] New: ICE when using ::ranges::v3::to<std::pmr::vector> 475647575 at qq dot com
                   ` (4 preceding siblings ...)
  2021-07-15 15:22 ` ppalka at gcc dot gnu.org
@ 2021-07-15 16:00 ` ppalka at gcc dot gnu.org
  2021-07-15 16:20 ` redi at gcc dot gnu.org
                   ` (3 subsequent siblings)
  9 siblings, 0 replies; 11+ messages in thread
From: ppalka at gcc dot gnu.org @ 2021-07-15 16:00 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=101233

--- Comment #5 from Patrick Palka <ppalka at gcc dot gnu.org> ---
Looks like the original testcase is indeed valid, but one needs to include
<memory_resource> as well (for pmr::polymorphic_allocator).

Reduced:

template<class T, class U>
struct A { A(T, U); };

template<class T, class U>
using B = A<U, T>;

using type = decltype(B{0, 0});

^ permalink raw reply	[flat|nested] 11+ messages in thread

* [Bug c++/101233] ICE when using ::ranges::v3::to<std::pmr::vector>
  2021-06-27 15:00 [Bug c++/101233] New: ICE when using ::ranges::v3::to<std::pmr::vector> 475647575 at qq dot com
                   ` (5 preceding siblings ...)
  2021-07-15 16:00 ` ppalka at gcc dot gnu.org
@ 2021-07-15 16:20 ` redi at gcc dot gnu.org
  2021-07-16 20:21 ` cvs-commit at gcc dot gnu.org
                   ` (2 subsequent siblings)
  9 siblings, 0 replies; 11+ messages in thread
From: redi at gcc dot gnu.org @ 2021-07-15 16:20 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=101233

--- Comment #6 from Jonathan Wakely <redi at gcc dot gnu.org> ---
(In reply to Patrick Palka from comment #5)
> but one needs to include
> <memory_resource> as well (for pmr::polymorphic_allocator).

For libstdc++ the <vector> header only declares the pmr::vector alias, without
defining prm::polymorphic_allocator. That means pmr::vector is an incomplete
type unless you also include <memory_resource>.

This is permitted by the standard, and avoids paying to include
<memory_resource> if you don't plan to use the pmr types.

^ permalink raw reply	[flat|nested] 11+ messages in thread

* [Bug c++/101233] ICE when using ::ranges::v3::to<std::pmr::vector>
  2021-06-27 15:00 [Bug c++/101233] New: ICE when using ::ranges::v3::to<std::pmr::vector> 475647575 at qq dot com
                   ` (6 preceding siblings ...)
  2021-07-15 16:20 ` redi at gcc dot gnu.org
@ 2021-07-16 20:21 ` cvs-commit at gcc dot gnu.org
  2021-07-16 22:49 ` cvs-commit at gcc dot gnu.org
  2021-07-16 22:52 ` ppalka at gcc dot gnu.org
  9 siblings, 0 replies; 11+ messages in thread
From: cvs-commit at gcc dot gnu.org @ 2021-07-16 20:21 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=101233

--- Comment #7 from CVS Commits <cvs-commit at gcc dot gnu.org> ---
The master branch has been updated by Patrick Palka <ppalka@gcc.gnu.org>:

https://gcc.gnu.org/g:a8b3861496bffae8b813ea196c1c5b27f79fbe69

commit r12-2378-ga8b3861496bffae8b813ea196c1c5b27f79fbe69
Author: Patrick Palka <ppalka@redhat.com>
Date:   Fri Jul 16 16:21:13 2021 -0400

    c++: alias CTAD in unevaluated context [PR101233]

    This is the alias CTAD version of the CTAD bug PR93248, and the fix is
    the same: clear cp_unevaluated_operand so that the entire chain of
    DECL_ARGUMENTS gets substituted.

            PR c++/101233

    gcc/cp/ChangeLog:

            * pt.c (alias_ctad_tweaks): Clear cp_unevaluated_operand for
            substituting DECL_ARGUMENTS.

    gcc/testsuite/ChangeLog:

            * g++.dg/cpp2a/class-deduction-alias10.C: New test.

^ permalink raw reply	[flat|nested] 11+ messages in thread

* [Bug c++/101233] ICE when using ::ranges::v3::to<std::pmr::vector>
  2021-06-27 15:00 [Bug c++/101233] New: ICE when using ::ranges::v3::to<std::pmr::vector> 475647575 at qq dot com
                   ` (7 preceding siblings ...)
  2021-07-16 20:21 ` cvs-commit at gcc dot gnu.org
@ 2021-07-16 22:49 ` cvs-commit at gcc dot gnu.org
  2021-07-16 22:52 ` ppalka at gcc dot gnu.org
  9 siblings, 0 replies; 11+ messages in thread
From: cvs-commit at gcc dot gnu.org @ 2021-07-16 22:49 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=101233

--- Comment #8 from CVS Commits <cvs-commit at gcc dot gnu.org> ---
The releases/gcc-11 branch has been updated by Patrick Palka
<ppalka@gcc.gnu.org>:

https://gcc.gnu.org/g:9107b139f4492d504df37e943882405e6aefdb7e

commit r11-8762-g9107b139f4492d504df37e943882405e6aefdb7e
Author: Patrick Palka <ppalka@redhat.com>
Date:   Fri Jul 16 16:21:13 2021 -0400

    c++: alias CTAD in unevaluated context [PR101233]

    This is the alias CTAD version of the CTAD bug PR93248, and the fix is
    the same: clear cp_unevaluated_operand so that the entire chain of
    DECL_ARGUMENTS gets substituted.

            PR c++/101233

    gcc/cp/ChangeLog:

            * pt.c (alias_ctad_tweaks): Clear cp_unevaluated_operand for
            substituting DECL_ARGUMENTS.

    gcc/testsuite/ChangeLog:

            * g++.dg/cpp2a/class-deduction-alias10.C: New test.

    (cherry picked from commit a8b3861496bffae8b813ea196c1c5b27f79fbe69)

^ permalink raw reply	[flat|nested] 11+ messages in thread

* [Bug c++/101233] ICE when using ::ranges::v3::to<std::pmr::vector>
  2021-06-27 15:00 [Bug c++/101233] New: ICE when using ::ranges::v3::to<std::pmr::vector> 475647575 at qq dot com
                   ` (8 preceding siblings ...)
  2021-07-16 22:49 ` cvs-commit at gcc dot gnu.org
@ 2021-07-16 22:52 ` ppalka at gcc dot gnu.org
  9 siblings, 0 replies; 11+ messages in thread
From: ppalka at gcc dot gnu.org @ 2021-07-16 22:52 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=101233

Patrick Palka <ppalka at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|ASSIGNED                    |RESOLVED
   Target Milestone|---                         |11.2
         Resolution|---                         |FIXED

--- Comment #9 from Patrick Palka <ppalka at gcc dot gnu.org> ---
Fixed for GCC 11.2 and 12.

^ permalink raw reply	[flat|nested] 11+ messages in thread

end of thread, other threads:[~2021-07-16 22:52 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-06-27 15:00 [Bug c++/101233] New: ICE when using ::ranges::v3::to<std::pmr::vector> 475647575 at qq dot com
2021-06-28  7:31 ` [Bug c++/101233] " marxin at gcc dot gnu.org
2021-06-28 10:08 ` 475647575 at qq dot com
2021-06-28 10:26 ` marxin at gcc dot gnu.org
2021-06-28 10:34 ` 475647575 at qq dot com
2021-07-15 15:22 ` ppalka at gcc dot gnu.org
2021-07-15 16:00 ` ppalka at gcc dot gnu.org
2021-07-15 16:20 ` redi at gcc dot gnu.org
2021-07-16 20:21 ` cvs-commit at gcc dot gnu.org
2021-07-16 22:49 ` cvs-commit at gcc dot gnu.org
2021-07-16 22:52 ` ppalka at gcc dot gnu.org

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).