[Bug c++/61575] New: [4.9 Regression] Bogus invalid initialization of reference of type 'const D&' from expression of type '<brace-enclosed initializer list>'
ppluzhnikov at google dot com
gcc-bugzilla@gcc.gnu.org
Fri Jun 20 21:13:00 GMT 2014
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
'<brace-enclosed initializer list>'
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 '<brace-enclosed initializer list>'
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
More information about the Gcc-bugs
mailing list