This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c++/56285] New: [C++11] Arguments to an inheriting constructor is not forwarded properly
- From: "lucdanton at free dot fr" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Mon, 11 Feb 2013 11:56:12 +0000
- Subject: [Bug c++/56285] New: [C++11] Arguments to an inheriting constructor is not forwarded properly
- Auto-submitted: auto-generated
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=56285
Bug #: 56285
Summary: [C++11] Arguments to an inheriting constructor is not
forwarded properly
Classification: Unclassified
Product: gcc
Version: 4.8.0
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: c++
AssignedTo: unassigned@gcc.gnu.org
ReportedBy: lucdanton@free.fr
Created attachment 29417
--> http://gcc.gnu.org/bugzilla/attachment.cgi?id=29417
Minimal reproducible testcase
$ g++-snapshot --version
g++-snapshot (Debian 20130209-1) 4.8.0 20130209 (experimental) [trunk revision
195917]
$ cat main.cpp
struct foo {
explicit foo(int&&) {}
};
struct bar: private foo {
using foo::foo;
};
int main()
{
bar b { 42 };
}
$ g++-snapshot -Wall -std=c++11 main.cpp
main.cpp: In constructor 'bar::bar(int&&)':
main.cpp:6:16: error: cannot bind 'int' lvalue to 'int&&'
using foo::foo;
^
main.cpp:2:14: error: initializing argument 1 of 'foo::foo(int&&)'
explicit foo(int&&) {}
^
main.cpp: In function 'int main()':
main.cpp:11:16: note: synthesized method 'bar::bar(int&&)' first required here
bar b { 42 };