This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c++/41672] New: missing diagnostic on an ill-formed rvalue reference initialization
- From: "msebor at gmail dot com" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 10 Oct 2009 21:55:42 -0000
- Subject: [Bug c++/41672] New: missing diagnostic on an ill-formed rvalue reference initialization
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
According to [dcl.init.ref], p5 of the latest working paper (N2960),
A reference to type ?cv1 T1? is initialized by an expression of type
?cv2 T2? as follows:
...
...the reference shall be an lvalue reference to a non-volatile const
type (i.e., cv1 shall be const), or the reference shall be an rvalue
reference and the initializer expression shall be an rvalue.
The following ill-formed program is accepted by gcc 4.4.1:
$ cat u.cpp && gcc -dumpversion \
&& gcc -W -Wall -c -std=c++0x u.cpp && echo FAIL
extern int &ir;
int &&irr = ir; // ill-formed
4.4.1
FAIL
--
Summary: missing diagnostic on an ill-formed rvalue reference
initialization
Product: gcc
Version: 4.4.1
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: c++
AssignedTo: unassigned at gcc dot gnu dot org
ReportedBy: msebor at gmail dot com
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=41672