This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c++/50025] C++0x initialization syntax doesn't work for class members of reference type
- From: "redi at gcc dot gnu.org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Mon, 8 Aug 2011 22:46:46 +0000
- Subject: [Bug c++/50025] C++0x initialization syntax doesn't work for class members of reference type
- Auto-submitted: auto-generated
- References: <bug-50025-4@http.gcc.gnu.org/bugzilla/>
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=50025
--- Comment #2 from Jonathan Wakely <redi at gcc dot gnu.org> 2011-08-08 22:46:31 UTC ---
It's not just class members, it applies to list-initialization of any reference
type:
int i;
int& ir{ i };
The FDIS requires a temporary to be created, and a non-const reference cannot
bind to a temporary.