Created attachment 29417 [details] 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 };
[class.inhctor]/8 says bar should have an implicitly-defined constructor equivalent to bar(int&& p) : foo(static_cast<int&&>(p)) { }
Author: jason Date: Tue Feb 12 20:47:15 2013 New Revision: 195990 URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=195990 Log: PR c++/56285 * method.c (add_one_base_init): Handle base constructor taking rvalue reference parm. Added: trunk/gcc/testsuite/g++.dg/cpp0x/inh-ctor16.C Modified: trunk/gcc/cp/ChangeLog trunk/gcc/cp/method.c
Fixed.
*** Bug 56317 has been marked as a duplicate of this bug. ***