public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c++/114562] New: ICE when trying to bind rvalue reference to lvalue with comma operator and forwarding reference to pointer
@ 2024-04-02 10:15 Liam.Jackson@qa-systems.com
  2024-04-02 14:35 ` [Bug c++/114562] [11/12/13/14 Regression] ICE when trying to bind rvalue reference to lvalue with comma operator and forwarding reference to pointer since r10-7410 jakub at gcc dot gnu.org
                   ` (6 more replies)
  0 siblings, 7 replies; 8+ messages in thread
From: Liam.Jackson@qa-systems.com @ 2024-04-02 10:15 UTC (permalink / raw)
  To: gcc-bugs

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

            Bug ID: 114562
           Summary: ICE when trying to bind rvalue reference to lvalue
                    with comma operator and forwarding reference to
                    pointer
           Product: gcc
           Version: 14.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c++
          Assignee: unassigned at gcc dot gnu.org
          Reporter: Liam.Jackson@qa-systems.com
  Target Milestone: ---

Created attachment 57846
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=57846&action=edit
Source to reproduce ice

Compiling the attached source would expect to raise an error such as 

error: cannot bind rvalue reference of type 'const void*&&' to lvalue of type
'void* const'

Instead the following ICE occurs:

<source>: In instantiation of 'static T Create<T>::create(U&&) [with U = void*
const&; T = MyClass]':
<source>:34:28:   required from here
   34 |     Create<MyClass>::create(MyClass::NONE);
      |     ~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~
<source>:28:13: internal compiler error: in convert_like_internal, at
cp/call.cc:8879
   28 |      return T( ( (beforeParam()), (u) ) );
      |             ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~
0x266d8bc internal_error(char const*, ...)
        ???:0
0xa572eb fancy_abort(char const*, int, char const*)
        ???:0
0xa81334 build_new_method_call(tree_node*, tree_node*, vec<tree_node*, va_gc,
vl_embed>**, tree_node*, int, tree_node**, int)
        ???:0
0xa8265b build_special_member_call(tree_node*, tree_node*, vec<tree_node*,
va_gc, vl_embed>**, tree_node*, int, int)
        ???:0
0xa8ff69 perform_direct_initialization_if_possible(tree_node*, tree_node*,
bool, int)
        ???:0
0xd33f73 build_functional_cast(unsigned int, tree_node*, tree_node*, int)
        ???:0
0xc92ed3 instantiate_decl(tree_node*, bool, bool)
        ???:0
0xcbc0ab instantiate_pending_templates(int)
        ???:0
0xb5a619 c_parse_final_cleanups()
        ???:0
0xdaf328 c_common_parse_file()
        ???:0


It may be possible to construct an example source which is expected to compile
successfully yet still triggers this ICE. This has not been explored.

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

* [Bug c++/114562] [11/12/13/14 Regression] ICE when trying to bind rvalue reference to lvalue with comma operator and forwarding reference to pointer since r10-7410
  2024-04-02 10:15 [Bug c++/114562] New: ICE when trying to bind rvalue reference to lvalue with comma operator and forwarding reference to pointer Liam.Jackson@qa-systems.com
@ 2024-04-02 14:35 ` jakub at gcc dot gnu.org
  2024-04-02 14:50 ` jason at gcc dot gnu.org
                   ` (5 subsequent siblings)
  6 siblings, 0 replies; 8+ messages in thread
From: jakub at gcc dot gnu.org @ 2024-04-02 14:35 UTC (permalink / raw)
  To: gcc-bugs

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

Jakub Jelinek <jakub at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
   Target Milestone|---                         |11.5
           Priority|P3                          |P2
            Summary|ICE when trying to bind     |[11/12/13/14 Regression]
                   |rvalue reference to lvalue  |ICE when trying to bind
                   |with comma operator and     |rvalue reference to lvalue
                   |forwarding reference to     |with comma operator and
                   |pointer                     |forwarding reference to
                   |                            |pointer since r10-7410
     Ever confirmed|0                           |1
                 CC|                            |jakub at gcc dot gnu.org
   Last reconfirmed|                            |2024-04-02
             Status|UNCONFIRMED                 |NEW

--- Comment #1 from Jakub Jelinek <jakub at gcc dot gnu.org> ---
Started to ICE with r10-7410-g72809d6fe8e085440403ce125c51d01d6e7512b0

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

* [Bug c++/114562] [11/12/13/14 Regression] ICE when trying to bind rvalue reference to lvalue with comma operator and forwarding reference to pointer since r10-7410
  2024-04-02 10:15 [Bug c++/114562] New: ICE when trying to bind rvalue reference to lvalue with comma operator and forwarding reference to pointer Liam.Jackson@qa-systems.com
  2024-04-02 14:35 ` [Bug c++/114562] [11/12/13/14 Regression] ICE when trying to bind rvalue reference to lvalue with comma operator and forwarding reference to pointer since r10-7410 jakub at gcc dot gnu.org
@ 2024-04-02 14:50 ` jason at gcc dot gnu.org
  2024-04-02 18:11 ` cvs-commit at gcc dot gnu.org
                   ` (4 subsequent siblings)
  6 siblings, 0 replies; 8+ messages in thread
From: jason at gcc dot gnu.org @ 2024-04-02 14:50 UTC (permalink / raw)
  To: gcc-bugs

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

Jason Merrill <jason at gcc dot gnu.org> changed:

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

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

* [Bug c++/114562] [11/12/13/14 Regression] ICE when trying to bind rvalue reference to lvalue with comma operator and forwarding reference to pointer since r10-7410
  2024-04-02 10:15 [Bug c++/114562] New: ICE when trying to bind rvalue reference to lvalue with comma operator and forwarding reference to pointer Liam.Jackson@qa-systems.com
  2024-04-02 14:35 ` [Bug c++/114562] [11/12/13/14 Regression] ICE when trying to bind rvalue reference to lvalue with comma operator and forwarding reference to pointer since r10-7410 jakub at gcc dot gnu.org
  2024-04-02 14:50 ` jason at gcc dot gnu.org
@ 2024-04-02 18:11 ` cvs-commit at gcc dot gnu.org
  2024-05-01 20:31 ` [Bug c++/114562] [11/12/13 " cvs-commit at gcc dot gnu.org
                   ` (3 subsequent siblings)
  6 siblings, 0 replies; 8+ messages in thread
From: cvs-commit at gcc dot gnu.org @ 2024-04-02 18:11 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #2 from GCC Commits <cvs-commit at gcc dot gnu.org> ---
The trunk branch has been updated by Jason Merrill <jason@gcc.gnu.org>:

https://gcc.gnu.org/g:5d7e9a35024f065b25f61747859c7cb7a770c92b

commit r14-9757-g5d7e9a35024f065b25f61747859c7cb7a770c92b
Author: Jason Merrill <jason@redhat.com>
Date:   Tue Apr 2 10:52:28 2024 -0400

    c++: binding reference to comma expr [PR114561]

    We represent a reference binding where the referent type is more qualified
    by a ck_ref_bind around a ck_qual.  We performed the ck_qual and then tried
    to undo it with STRIP_NOPS, but that doesn't work if the conversion is
    buried in COMPOUND_EXPR.  So instead let's avoid performing that fake
    conversion in the first place.

            PR c++/114561
            PR c++/114562

    gcc/cp/ChangeLog:

            * call.cc (convert_like_internal): Avoid adding qualification
            conversion in direct reference binding.

    gcc/testsuite/ChangeLog:

            * g++.dg/conversion/ref10.C: New test.
            * g++.dg/conversion/ref11.C: New test.

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

* [Bug c++/114562] [11/12/13 Regression] ICE when trying to bind rvalue reference to lvalue with comma operator and forwarding reference to pointer since r10-7410
  2024-04-02 10:15 [Bug c++/114562] New: ICE when trying to bind rvalue reference to lvalue with comma operator and forwarding reference to pointer Liam.Jackson@qa-systems.com
                   ` (2 preceding siblings ...)
  2024-04-02 18:11 ` cvs-commit at gcc dot gnu.org
@ 2024-05-01 20:31 ` cvs-commit at gcc dot gnu.org
  2024-05-24 13:26 ` [Bug c++/114562] [11/12 " cvs-commit at gcc dot gnu.org
                   ` (2 subsequent siblings)
  6 siblings, 0 replies; 8+ messages in thread
From: cvs-commit at gcc dot gnu.org @ 2024-05-01 20:31 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #3 from GCC Commits <cvs-commit at gcc dot gnu.org> ---
The releases/gcc-13 branch has been updated by Jason Merrill
<jason@gcc.gnu.org>:

https://gcc.gnu.org/g:7bc362ea61e5bf552356aa862beb7845fe50a47c

commit r13-8668-g7bc362ea61e5bf552356aa862beb7845fe50a47c
Author: Jason Merrill <jason@redhat.com>
Date:   Tue Apr 2 10:52:28 2024 -0400

    c++: binding reference to comma expr [PR114561]

    We represent a reference binding where the referent type is more qualified
    by a ck_ref_bind around a ck_qual.  We performed the ck_qual and then tried
    to undo it with STRIP_NOPS, but that doesn't work if the conversion is
    buried in COMPOUND_EXPR.  So instead let's avoid performing that fake
    conversion in the first place.

            PR c++/114561
            PR c++/114562

    gcc/cp/ChangeLog:

            * call.cc (convert_like_internal): Avoid adding qualification
            conversion in direct reference binding.

    gcc/testsuite/ChangeLog:

            * g++.dg/conversion/ref10.C: New test.
            * g++.dg/conversion/ref11.C: New test.

    (cherry picked from commit 5d7e9a35024f065b25f61747859c7cb7a770c92b)

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

* [Bug c++/114562] [11/12 Regression] ICE when trying to bind rvalue reference to lvalue with comma operator and forwarding reference to pointer since r10-7410
  2024-04-02 10:15 [Bug c++/114562] New: ICE when trying to bind rvalue reference to lvalue with comma operator and forwarding reference to pointer Liam.Jackson@qa-systems.com
                   ` (3 preceding siblings ...)
  2024-05-01 20:31 ` [Bug c++/114562] [11/12/13 " cvs-commit at gcc dot gnu.org
@ 2024-05-24 13:26 ` cvs-commit at gcc dot gnu.org
  2024-05-24 13:27 ` cvs-commit at gcc dot gnu.org
  2024-05-24 13:30 ` jason at gcc dot gnu.org
  6 siblings, 0 replies; 8+ messages in thread
From: cvs-commit at gcc dot gnu.org @ 2024-05-24 13:26 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #4 from GCC Commits <cvs-commit at gcc dot gnu.org> ---
The releases/gcc-12 branch has been updated by Jason Merrill
<jason@gcc.gnu.org>:

https://gcc.gnu.org/g:7076c565e22281e193aeafafbf40676426a64b75

commit r12-10466-g7076c565e22281e193aeafafbf40676426a64b75
Author: Jason Merrill <jason@redhat.com>
Date:   Tue Apr 2 10:52:28 2024 -0400

    c++: binding reference to comma expr [PR114561]

    We represent a reference binding where the referent type is more qualified
    by a ck_ref_bind around a ck_qual.  We performed the ck_qual and then tried
    to undo it with STRIP_NOPS, but that doesn't work if the conversion is
    buried in COMPOUND_EXPR.  So instead let's avoid performing that fake
    conversion in the first place.

            PR c++/114561
            PR c++/114562

    gcc/cp/ChangeLog:

            * call.cc (convert_like_internal): Avoid adding qualification
            conversion in direct reference binding.

    gcc/testsuite/ChangeLog:

            * g++.dg/conversion/ref10.C: New test.
            * g++.dg/conversion/ref11.C: New test.

    (cherry picked from commit 5d7e9a35024f065b25f61747859c7cb7a770c92b)

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

* [Bug c++/114562] [11/12 Regression] ICE when trying to bind rvalue reference to lvalue with comma operator and forwarding reference to pointer since r10-7410
  2024-04-02 10:15 [Bug c++/114562] New: ICE when trying to bind rvalue reference to lvalue with comma operator and forwarding reference to pointer Liam.Jackson@qa-systems.com
                   ` (4 preceding siblings ...)
  2024-05-24 13:26 ` [Bug c++/114562] [11/12 " cvs-commit at gcc dot gnu.org
@ 2024-05-24 13:27 ` cvs-commit at gcc dot gnu.org
  2024-05-24 13:30 ` jason at gcc dot gnu.org
  6 siblings, 0 replies; 8+ messages in thread
From: cvs-commit at gcc dot gnu.org @ 2024-05-24 13:27 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #5 from GCC Commits <cvs-commit at gcc dot gnu.org> ---
The releases/gcc-11 branch has been updated by Jason Merrill
<jason@gcc.gnu.org>:

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

commit r11-11446-gb35afe75674ff9f79cf9685d099bc80f10442216
Author: Jason Merrill <jason@redhat.com>
Date:   Tue Apr 2 10:52:28 2024 -0400

    c++: binding reference to comma expr [PR114561]

    We represent a reference binding where the referent type is more qualified
    by a ck_ref_bind around a ck_qual.  We performed the ck_qual and then tried
    to undo it with STRIP_NOPS, but that doesn't work if the conversion is
    buried in COMPOUND_EXPR.  So instead let's avoid performing that fake
    conversion in the first place.

            PR c++/114561
            PR c++/114562

    gcc/cp/ChangeLog:

            * call.c (convert_like_internal): Avoid adding qualification
            conversion in direct reference binding.

    gcc/testsuite/ChangeLog:

            * g++.dg/conversion/ref10.C: New test.
            * g++.dg/conversion/ref11.C: New test.

    (cherry picked from commit 5d7e9a35024f065b25f61747859c7cb7a770c92b)

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

* [Bug c++/114562] [11/12 Regression] ICE when trying to bind rvalue reference to lvalue with comma operator and forwarding reference to pointer since r10-7410
  2024-04-02 10:15 [Bug c++/114562] New: ICE when trying to bind rvalue reference to lvalue with comma operator and forwarding reference to pointer Liam.Jackson@qa-systems.com
                   ` (5 preceding siblings ...)
  2024-05-24 13:27 ` cvs-commit at gcc dot gnu.org
@ 2024-05-24 13:30 ` jason at gcc dot gnu.org
  6 siblings, 0 replies; 8+ messages in thread
From: jason at gcc dot gnu.org @ 2024-05-24 13:30 UTC (permalink / raw)
  To: gcc-bugs

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

Jason Merrill <jason at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|ASSIGNED                    |RESOLVED
         Resolution|---                         |FIXED

--- Comment #6 from Jason Merrill <jason at gcc dot gnu.org> ---
Fixed in 11.5/12.4/13.3/14.

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

end of thread, other threads:[~2024-05-24 13:30 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2024-04-02 10:15 [Bug c++/114562] New: ICE when trying to bind rvalue reference to lvalue with comma operator and forwarding reference to pointer Liam.Jackson@qa-systems.com
2024-04-02 14:35 ` [Bug c++/114562] [11/12/13/14 Regression] ICE when trying to bind rvalue reference to lvalue with comma operator and forwarding reference to pointer since r10-7410 jakub at gcc dot gnu.org
2024-04-02 14:50 ` jason at gcc dot gnu.org
2024-04-02 18:11 ` cvs-commit at gcc dot gnu.org
2024-05-01 20:31 ` [Bug c++/114562] [11/12/13 " cvs-commit at gcc dot gnu.org
2024-05-24 13:26 ` [Bug c++/114562] [11/12 " cvs-commit at gcc dot gnu.org
2024-05-24 13:27 ` cvs-commit at gcc dot gnu.org
2024-05-24 13:30 ` jason 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).