public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c++/39923]  New: [C++0x] rvalue references
@ 2009-04-27  3:11 tom dot prince at ualberta dot net
  2009-04-27  3:12 ` [Bug c++/39923] " tom dot prince at ualberta dot net
                   ` (18 more replies)
  0 siblings, 19 replies; 20+ messages in thread
From: tom dot prince at ualberta dot net @ 2009-04-27  3:11 UTC (permalink / raw)
  To: gcc-bugs

Reference: 2857 section 13.3.3.2

There are some cases where GCC binds or fails to bind properly to rvalue
references: see details in attached test case.


-- 
           Summary: [C++0x] rvalue references
           Product: gcc
           Version: 4.5.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c++
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: tom dot prince at ualberta dot net
  GCC host triplet: x86_64-linux-gnu


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=39923


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

* [Bug c++/39923] [C++0x] rvalue references
  2009-04-27  3:11 [Bug c++/39923] New: [C++0x] rvalue references tom dot prince at ualberta dot net
@ 2009-04-27  3:12 ` tom dot prince at ualberta dot net
  2009-04-27  3:13 ` tom dot prince at ualberta dot net
                   ` (17 subsequent siblings)
  18 siblings, 0 replies; 20+ messages in thread
From: tom dot prince at ualberta dot net @ 2009-04-27  3:12 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #1 from tom dot prince at ualberta dot net  2009-04-27 03:12 -------
Created an attachment (id=17761)
 --> (http://gcc.gnu.org/bugzilla/attachment.cgi?id=17761&action=view)
Test Case


-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=39923


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

* [Bug c++/39923] [C++0x] rvalue references
  2009-04-27  3:11 [Bug c++/39923] New: [C++0x] rvalue references tom dot prince at ualberta dot net
  2009-04-27  3:12 ` [Bug c++/39923] " tom dot prince at ualberta dot net
@ 2009-04-27  3:13 ` tom dot prince at ualberta dot net
  2009-04-27  3:16 ` tom dot prince at ualberta dot net
                   ` (16 subsequent siblings)
  18 siblings, 0 replies; 20+ messages in thread
From: tom dot prince at ualberta dot net @ 2009-04-27  3:13 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #2 from tom dot prince at ualberta dot net  2009-04-27 03:13 -------
Created an attachment (id=17762)
 --> (http://gcc.gnu.org/bugzilla/attachment.cgi?id=17762&action=view)
gcc output


-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=39923


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

* [Bug c++/39923] [C++0x] rvalue references
  2009-04-27  3:11 [Bug c++/39923] New: [C++0x] rvalue references tom dot prince at ualberta dot net
                   ` (2 preceding siblings ...)
  2009-04-27  3:16 ` tom dot prince at ualberta dot net
@ 2009-04-27  3:16 ` tom dot prince at ualberta dot net
  2009-04-27  4:01 ` tom dot prince at ualberta dot net
                   ` (14 subsequent siblings)
  18 siblings, 0 replies; 20+ messages in thread
From: tom dot prince at ualberta dot net @ 2009-04-27  3:16 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #3 from tom dot prince at ualberta dot net  2009-04-27 03:15 -------
Created an attachment (id=17763)
 --> (http://gcc.gnu.org/bugzilla/attachment.cgi?id=17763&action=view)
GCC version details


-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=39923


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

* [Bug c++/39923] [C++0x] rvalue references
  2009-04-27  3:11 [Bug c++/39923] New: [C++0x] rvalue references tom dot prince at ualberta dot net
  2009-04-27  3:12 ` [Bug c++/39923] " tom dot prince at ualberta dot net
  2009-04-27  3:13 ` tom dot prince at ualberta dot net
@ 2009-04-27  3:16 ` tom dot prince at ualberta dot net
  2009-04-27  3:16 ` tom dot prince at ualberta dot net
                   ` (15 subsequent siblings)
  18 siblings, 0 replies; 20+ messages in thread
From: tom dot prince at ualberta dot net @ 2009-04-27  3:16 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #4 from tom dot prince at ualberta dot net  2009-04-27 03:16 -------
Created an attachment (id=17764)
 --> (http://gcc.gnu.org/bugzilla/attachment.cgi?id=17764&action=view)
GCC version details


-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=39923


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

* [Bug c++/39923] [C++0x] rvalue references
  2009-04-27  3:11 [Bug c++/39923] New: [C++0x] rvalue references tom dot prince at ualberta dot net
                   ` (3 preceding siblings ...)
  2009-04-27  3:16 ` tom dot prince at ualberta dot net
@ 2009-04-27  4:01 ` tom dot prince at ualberta dot net
  2009-04-27  9:18 ` paolo dot carlini at oracle dot com
                   ` (13 subsequent siblings)
  18 siblings, 0 replies; 20+ messages in thread
From: tom dot prince at ualberta dot net @ 2009-04-27  4:01 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #5 from tom dot prince at ualberta dot net  2009-04-27 04:01 -------
Further consideration seems to indicate that the standard spuriously allows the
second case to be illegal.


-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=39923


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

* [Bug c++/39923] [C++0x] rvalue references
  2009-04-27  3:11 [Bug c++/39923] New: [C++0x] rvalue references tom dot prince at ualberta dot net
                   ` (4 preceding siblings ...)
  2009-04-27  4:01 ` tom dot prince at ualberta dot net
@ 2009-04-27  9:18 ` paolo dot carlini at oracle dot com
  2009-04-27 14:51 ` tom dot prince at ualberta dot net
                   ` (12 subsequent siblings)
  18 siblings, 0 replies; 20+ messages in thread
From: paolo dot carlini at oracle dot com @ 2009-04-27  9:18 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #6 from paolo dot carlini at oracle dot com  2009-04-27 09:18 -------
I'm sorry, about the second case, don't you have to std::move(a), in order to
accomplish what you want? At, least, this is what we consistently do in the
experimental bits of the library.


-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=39923


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

* [Bug c++/39923] [C++0x] rvalue references
  2009-04-27  3:11 [Bug c++/39923] New: [C++0x] rvalue references tom dot prince at ualberta dot net
                   ` (5 preceding siblings ...)
  2009-04-27  9:18 ` paolo dot carlini at oracle dot com
@ 2009-04-27 14:51 ` tom dot prince at ualberta dot net
  2009-04-27 14:52 ` tom dot prince at ualberta dot net
                   ` (11 subsequent siblings)
  18 siblings, 0 replies; 20+ messages in thread
From: tom dot prince at ualberta dot net @ 2009-04-27 14:51 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #7 from tom dot prince at ualberta dot net  2009-04-27 14:50 -------
Created an attachment (id=17767)
 --> (http://gcc.gnu.org/bugzilla/attachment.cgi?id=17767&action=view)
Various failed attempts to create a std::vector<std::unique_ptr<int>> from an
intializer list.

These are my attempts at creating a std::vector using an intilializer_list of
movable but not copyable objects.

I don't think the standard requires this to be possible, but I would suspect
this is merely an oversight.

Also, the last function here generates an ICE (errors attached).


-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=39923


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

* [Bug c++/39923] [C++0x] rvalue references
  2009-04-27  3:11 [Bug c++/39923] New: [C++0x] rvalue references tom dot prince at ualberta dot net
                   ` (6 preceding siblings ...)
  2009-04-27 14:51 ` tom dot prince at ualberta dot net
@ 2009-04-27 14:52 ` tom dot prince at ualberta dot net
  2009-04-27 15:02 ` tom dot prince at ualberta dot net
                   ` (10 subsequent siblings)
  18 siblings, 0 replies; 20+ messages in thread
From: tom dot prince at ualberta dot net @ 2009-04-27 14:52 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #8 from tom dot prince at ualberta dot net  2009-04-27 14:52 -------
Created an attachment (id=17768)
 --> (http://gcc.gnu.org/bugzilla/attachment.cgi?id=17768&action=view)
ICE from test2.cc

The errors test2.cc generate vary if the various functions are commented out.


-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=39923


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

* [Bug c++/39923] [C++0x] rvalue references
  2009-04-27  3:11 [Bug c++/39923] New: [C++0x] rvalue references tom dot prince at ualberta dot net
                   ` (7 preceding siblings ...)
  2009-04-27 14:52 ` tom dot prince at ualberta dot net
@ 2009-04-27 15:02 ` tom dot prince at ualberta dot net
  2009-04-27 15:25 ` paolo dot carlini at oracle dot com
                   ` (9 subsequent siblings)
  18 siblings, 0 replies; 20+ messages in thread
From: tom dot prince at ualberta dot net @ 2009-04-27 15:02 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #9 from tom dot prince at ualberta dot net  2009-04-27 15:01 -------
This is an old patch that purports to fix 3rd of the original tests.

http://gcc.gnu.org/ml/gcc-patches/2008-10/msg00436.html


-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=39923


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

* [Bug c++/39923] [C++0x] rvalue references
  2009-04-27  3:11 [Bug c++/39923] New: [C++0x] rvalue references tom dot prince at ualberta dot net
                   ` (8 preceding siblings ...)
  2009-04-27 15:02 ` tom dot prince at ualberta dot net
@ 2009-04-27 15:25 ` paolo dot carlini at oracle dot com
  2009-04-27 15:43 ` tom dot prince at ualberta dot net
                   ` (8 subsequent siblings)
  18 siblings, 0 replies; 20+ messages in thread
From: paolo dot carlini at oracle dot com @ 2009-04-27 15:25 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #10 from paolo dot carlini at oracle dot com  2009-04-27 15:24 -------
So, let me understand, as in a previous PR of yours, the problem boils down to
intializer_lists only?

CC-ing Jason in any case, because of the ICE.


-- 

paolo dot carlini at oracle dot com changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |jason at gcc dot gnu dot org


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=39923


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

* [Bug c++/39923] [C++0x] rvalue references
  2009-04-27  3:11 [Bug c++/39923] New: [C++0x] rvalue references tom dot prince at ualberta dot net
                   ` (9 preceding siblings ...)
  2009-04-27 15:25 ` paolo dot carlini at oracle dot com
@ 2009-04-27 15:43 ` tom dot prince at ualberta dot net
  2009-04-27 15:56 ` paolo dot carlini at oracle dot com
                   ` (7 subsequent siblings)
  18 siblings, 0 replies; 20+ messages in thread
From: tom dot prince at ualberta dot net @ 2009-04-27 15:43 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #11 from tom dot prince at ualberta dot net  2009-04-27 15:43 -------
Also, there is the issue of lvalues binding to rvalue references. See N2831 and
possibly n2835.


-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=39923


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

* [Bug c++/39923] [C++0x] rvalue references
  2009-04-27  3:11 [Bug c++/39923] New: [C++0x] rvalue references tom dot prince at ualberta dot net
                   ` (10 preceding siblings ...)
  2009-04-27 15:43 ` tom dot prince at ualberta dot net
@ 2009-04-27 15:56 ` paolo dot carlini at oracle dot com
  2009-04-27 15:58 ` paolo dot carlini at oracle dot com
                   ` (6 subsequent siblings)
  18 siblings, 0 replies; 20+ messages in thread
From: paolo dot carlini at oracle dot com @ 2009-04-27 15:56 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #12 from paolo dot carlini at oracle dot com  2009-04-27 15:55 -------
But n2831 is about rvalues binding to lvalues, not the other way around.


-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=39923


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

* [Bug c++/39923] [C++0x] rvalue references
  2009-04-27  3:11 [Bug c++/39923] New: [C++0x] rvalue references tom dot prince at ualberta dot net
                   ` (11 preceding siblings ...)
  2009-04-27 15:56 ` paolo dot carlini at oracle dot com
@ 2009-04-27 15:58 ` paolo dot carlini at oracle dot com
  2009-04-27 16:26 ` tom dot prince at ualberta dot net
                   ` (5 subsequent siblings)
  18 siblings, 0 replies; 20+ messages in thread
From: paolo dot carlini at oracle dot com @ 2009-04-27 15:58 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #13 from paolo dot carlini at oracle dot com  2009-04-27 15:58 -------
I meant rvalue references binding to lvalues, of course.


-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=39923


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

* [Bug c++/39923] [C++0x] rvalue references
  2009-04-27  3:11 [Bug c++/39923] New: [C++0x] rvalue references tom dot prince at ualberta dot net
                   ` (12 preceding siblings ...)
  2009-04-27 15:58 ` paolo dot carlini at oracle dot com
@ 2009-04-27 16:26 ` tom dot prince at ualberta dot net
  2009-04-27 16:32 ` paolo dot carlini at oracle dot com
                   ` (4 subsequent siblings)
  18 siblings, 0 replies; 20+ messages in thread
From: tom dot prince at ualberta dot net @ 2009-04-27 16:26 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #14 from tom dot prince at ualberta dot net  2009-04-27 16:25 -------
The updated version n2844. From the intro: (I guess I meant "being bound to" in
the language of the standard)

int i = 2;
double &&d = i; // previously well-formed (d bound to a temporary double), now
ill-formed



-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=39923


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

* [Bug c++/39923] [C++0x] rvalue references
  2009-04-27  3:11 [Bug c++/39923] New: [C++0x] rvalue references tom dot prince at ualberta dot net
                   ` (13 preceding siblings ...)
  2009-04-27 16:26 ` tom dot prince at ualberta dot net
@ 2009-04-27 16:32 ` paolo dot carlini at oracle dot com
  2009-04-27 17:11 ` [Bug c++/39923] [C++0x] ICE in build_init_list_var_init paolo dot carlini at oracle dot com
                   ` (3 subsequent siblings)
  18 siblings, 0 replies; 20+ messages in thread
From: paolo dot carlini at oracle dot com @ 2009-04-27 16:32 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #15 from paolo dot carlini at oracle dot com  2009-04-27 16:32 -------
Nope. The issue is the usual one: obviously d is an rvalue reference binding
the lvalue i.


-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=39923


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

* [Bug c++/39923] [C++0x] ICE in build_init_list_var_init
  2009-04-27  3:11 [Bug c++/39923] New: [C++0x] rvalue references tom dot prince at ualberta dot net
                   ` (14 preceding siblings ...)
  2009-04-27 16:32 ` paolo dot carlini at oracle dot com
@ 2009-04-27 17:11 ` paolo dot carlini at oracle dot com
  2009-09-08 20:49 ` paolo dot carlini at oracle dot com
                   ` (2 subsequent siblings)
  18 siblings, 0 replies; 20+ messages in thread
From: paolo dot carlini at oracle dot com @ 2009-04-27 17:11 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #16 from paolo dot carlini at oracle dot com  2009-04-27 17:10 -------
And, by the way, as regards my Comment #6, which really was about your case 1
in the first testcase, I confirm GCC is already fine: a is always treated as an
lvalue in the body of the function. Also, the test is malformed for other
reasons, there is no constructor possibly accepting a as argument.

I'm also renaming the summary.


-- 

paolo dot carlini at oracle dot com changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |NEW
     Ever Confirmed|0                           |1
           Keywords|                            |ice-on-invalid-code
   Last reconfirmed|0000-00-00 00:00:00         |2009-04-27 17:10:57
               date|                            |
            Summary|[C++0x] rvalue references   |[C++0x] ICE in
                   |                            |build_init_list_var_init


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=39923


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

* [Bug c++/39923] [C++0x] ICE in build_init_list_var_init
  2009-04-27  3:11 [Bug c++/39923] New: [C++0x] rvalue references tom dot prince at ualberta dot net
                   ` (15 preceding siblings ...)
  2009-04-27 17:11 ` [Bug c++/39923] [C++0x] ICE in build_init_list_var_init paolo dot carlini at oracle dot com
@ 2009-09-08 20:49 ` paolo dot carlini at oracle dot com
  2009-09-08 22:01 ` paolo at gcc dot gnu dot org
  2009-09-08 22:02 ` paolo dot carlini at oracle dot com
  18 siblings, 0 replies; 20+ messages in thread
From: paolo dot carlini at oracle dot com @ 2009-09-08 20:49 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #17 from paolo dot carlini at oracle dot com  2009-09-08 20:48 -------
On it.


-- 

paolo dot carlini at oracle dot com changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
         AssignedTo|unassigned at gcc dot gnu   |paolo dot carlini at oracle
                   |dot org                     |dot com
             Status|NEW                         |ASSIGNED


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=39923


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

* [Bug c++/39923] [C++0x] ICE in build_init_list_var_init
  2009-04-27  3:11 [Bug c++/39923] New: [C++0x] rvalue references tom dot prince at ualberta dot net
                   ` (16 preceding siblings ...)
  2009-09-08 20:49 ` paolo dot carlini at oracle dot com
@ 2009-09-08 22:01 ` paolo at gcc dot gnu dot org
  2009-09-08 22:02 ` paolo dot carlini at oracle dot com
  18 siblings, 0 replies; 20+ messages in thread
From: paolo at gcc dot gnu dot org @ 2009-09-08 22:01 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #18 from paolo at gcc dot gnu dot org  2009-09-08 22:01 -------
Subject: Bug 39923

Author: paolo
Date: Tue Sep  8 22:00:42 2009
New Revision: 151536

URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=151536
Log:
/cp
2009-09-08  Paolo Carlini  <paolo.carlini@oracle.com>

        PR c++/39923
        * decl.c (build_init_list_var_init): Check return value of
        perform_implicit_conversion.

/testsuite
2009-09-08  Paolo Carlini  <paolo.carlini@oracle.com>

        PR c++/39923
        * g++.dg/cpp0x/initlist24.C: New.

Added:
    trunk/gcc/testsuite/g++.dg/cpp0x/initlist24.C
Modified:
    trunk/gcc/cp/ChangeLog
    trunk/gcc/cp/decl.c
    trunk/gcc/testsuite/ChangeLog


-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=39923


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

* [Bug c++/39923] [C++0x] ICE in build_init_list_var_init
  2009-04-27  3:11 [Bug c++/39923] New: [C++0x] rvalue references tom dot prince at ualberta dot net
                   ` (17 preceding siblings ...)
  2009-09-08 22:01 ` paolo at gcc dot gnu dot org
@ 2009-09-08 22:02 ` paolo dot carlini at oracle dot com
  18 siblings, 0 replies; 20+ messages in thread
From: paolo dot carlini at oracle dot com @ 2009-09-08 22:02 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #19 from paolo dot carlini at oracle dot com  2009-09-08 22:01 -------
Fixed.


-- 

paolo dot carlini at oracle dot com changed:

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


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=39923


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

end of thread, other threads:[~2009-09-08 22:02 UTC | newest]

Thread overview: 20+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2009-04-27  3:11 [Bug c++/39923] New: [C++0x] rvalue references tom dot prince at ualberta dot net
2009-04-27  3:12 ` [Bug c++/39923] " tom dot prince at ualberta dot net
2009-04-27  3:13 ` tom dot prince at ualberta dot net
2009-04-27  3:16 ` tom dot prince at ualberta dot net
2009-04-27  3:16 ` tom dot prince at ualberta dot net
2009-04-27  4:01 ` tom dot prince at ualberta dot net
2009-04-27  9:18 ` paolo dot carlini at oracle dot com
2009-04-27 14:51 ` tom dot prince at ualberta dot net
2009-04-27 14:52 ` tom dot prince at ualberta dot net
2009-04-27 15:02 ` tom dot prince at ualberta dot net
2009-04-27 15:25 ` paolo dot carlini at oracle dot com
2009-04-27 15:43 ` tom dot prince at ualberta dot net
2009-04-27 15:56 ` paolo dot carlini at oracle dot com
2009-04-27 15:58 ` paolo dot carlini at oracle dot com
2009-04-27 16:26 ` tom dot prince at ualberta dot net
2009-04-27 16:32 ` paolo dot carlini at oracle dot com
2009-04-27 17:11 ` [Bug c++/39923] [C++0x] ICE in build_init_list_var_init paolo dot carlini at oracle dot com
2009-09-08 20:49 ` paolo dot carlini at oracle dot com
2009-09-08 22:01 ` paolo at gcc dot gnu dot org
2009-09-08 22:02 ` paolo dot carlini at oracle dot com

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).