From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 2004 invoked by alias); 20 Jun 2014 21:13:00 -0000 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 Received: (qmail 1989 invoked by uid 48); 20 Jun 2014 21:12:56 -0000 From: "ppluzhnikov at google dot com" To: gcc-bugs@gcc.gnu.org Subject: [Bug c++/61575] New: [4.9 Regression] Bogus invalid initialization of reference of type 'const D&' from expression of type '' Date: Fri, 20 Jun 2014 21:13:00 -0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: new X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: c++ X-Bugzilla-Version: unknown X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: ppluzhnikov at google dot com X-Bugzilla-Status: UNCONFIRMED X-Bugzilla-Priority: P3 X-Bugzilla-Assigned-To: unassigned at gcc dot gnu.org X-Bugzilla-Target-Milestone: --- X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: bug_id short_desc product version bug_status bug_severity priority component assigned_to reporter Message-ID: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: 7bit X-Bugzilla-URL: http://gcc.gnu.org/bugzilla/ Auto-Submitted: auto-generated MIME-Version: 1.0 X-SW-Source: 2014-06/txt/msg01706.txt.bz2 https://gcc.gnu.org/bugzilla/show_bug.cgi?id=61575 Bug ID: 61575 Summary: [4.9 Regression] Bogus invalid initialization of reference of type 'const D&' from expression of type '' Product: gcc Version: unknown Status: UNCONFIRMED Severity: normal Priority: P3 Component: c++ Assignee: unassigned at gcc dot gnu.org Reporter: ppluzhnikov at google dot com Google ref: b/15094102 The following test compiles with gcc-4.8 and trunk, fails with current gcc-4_9-branch: /// -- cut --- struct D { const int &x; const int &y; }; int Create (const D &); void fn1 () { Create ( { {}, {} }); } /// -- cut --- gcc-svn-4_9-r211828/bin/gcc -c -std=c++11 t.ii gcc-svn-4_9-r211175/bin/gcc -c -std=c++11 t.ii t.ii: In function 'void fn1()': t.ii:10:22: error: invalid initialization of reference of type 'const D&' from expression of type '' Create ( { {}, {} }); ^ t.ii:6:5: note: in passing argument 1 of 'int Create(const D&)' int Create (const D &); ^ The source is accepted by Clang, and trunk (@r211826). It was rejected by trunk in the past: OK gcc-svn-r195189/bin/gcc OK gcc-svn-r197259/bin/gcc OK gcc-svn-r198246/bin/gcc OK gcc-svn-r198956/bin/gcc OK gcc-svn-r199779/bin/gcc OK gcc-svn-r199793/bin/gcc OK gcc-svn-r199956/bin/gcc OK gcc-svn-r200178/bin/gcc ... broke somewhere here KO gcc-svn-r210292/bin/gcc KO gcc-svn-r210629/bin/gcc ... refixed somewhere here OK gcc-svn-r211159/bin/gcc OK gcc-svn-r211286/bin/gcc OK gcc-svn-r211479/bin/gcc OK gcc-svn-r211743/bin/gcc OK gcc-svn-r211826/bin/gcc