[Bug c++/39901] New: [C++0x] Initializer list not allowed in []
According to n2531, the new C++0x initializer-list is allowed in []. Test Case: #include void test(void) { std::map,int> the_map; the_map[{0,1}] = 5; } Error: /tmp/test.cc: In function void test(): /tmp/test.cc:6: error: expected primary-expression before { token /tmp/test.cc:6: error: expected ] before { token /tmp/test.cc:6: error: expected ; before { token /tmp/test.cc:6: error: expected primary-expression before ] token /tmp/test.cc:6: error: expected ; before ] token Using built-in specs. Target: x86_64-unknown-linux-gnu Configured with: ./configure --enable-languages=c++ --enable-shared --enable-threads=posix --enable-__cxa_atexit --disable-multilib --disable-bootstrap --prefix /Users/cougar/local/gcc45 : (reconfigured) ./config ure --enable-shared --enable-threads=posix --enable-__cxa_atexit --disable-multilib --disable-bootstrap --prefix /Users/cougar/local/gcc45 --enable-languages=c,c++ --no-create --no-recursion Thread model: posix gcc version 4.5.0 20090425 (experimental) (GCC) -- Summary: [C++0x] Initializer list not allowed in [] 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=39901
[Bug c++/39923] New: [C++0x] rvalue references
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
[Bug c++/39923] [C++0x] rvalue references
--- 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
[Bug c++/39923] [C++0x] rvalue references
--- 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
[Bug c++/39923] [C++0x] rvalue references
--- 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
[Bug c++/39923] [C++0x] rvalue references
--- 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
[Bug c++/39923] [C++0x] rvalue references
--- 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
[Bug c++/39923] [C++0x] rvalue references
--- 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> 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
[Bug c++/39923] [C++0x] rvalue references
--- 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
[Bug c++/39923] [C++0x] rvalue references
--- 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
[Bug c++/39923] [C++0x] rvalue references
--- 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
[Bug c++/39923] [C++0x] rvalue references
--- 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