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: unassig...@gcc.gnu.org

        ReportedBy: lucdan...@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 };

Reply via email to