From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 14081 invoked by alias); 10 Oct 2009 21:56:11 -0000 Received: (qmail 12398 invoked by uid 48); 10 Oct 2009 21:55:42 -0000 Date: Sat, 10 Oct 2009 21:56:00 -0000 Subject: [Bug c++/41672] New: missing diagnostic on an ill-formed rvalue reference initialization X-Bugzilla-Reason: CC Message-ID: Reply-To: gcc-bugzilla@gcc.gnu.org To: gcc-bugs@gcc.gnu.org From: "msebor at gmail dot com" Mailing-List: contact gcc-bugs-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Archive: List-Post: List-Help: Sender: gcc-bugs-owner@gcc.gnu.org X-SW-Source: 2009-10/txt/msg00922.txt.bz2 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