http://gcc.gnu.org/bugzilla/show_bug.cgi?id=57153



             Bug #: 57153

           Summary: [C++11] tries to use copy constructor for in-class

                    initialized member in default constructor of template

                    struct

    Classification: Unclassified

           Product: gcc

           Version: 4.7.2

            Status: UNCONFIRMED

          Severity: normal

          Priority: P3

         Component: c++

        AssignedTo: unassig...@gcc.gnu.org

        ReportedBy: f.heckenb...@fh-soft.de





Created attachment 30014

  --> http://gcc.gnu.org/bugzilla/attachment.cgi?id=30014

Test case



The included test case produces the following error:



% g++-4.7 -std=c++11 test.cpp 

test.cpp: In constructor 'constexpr B<0>::B()':

test.cpp:8:8: error: use of deleted function 'A::A(const A&)'

test.cpp:4:3: error: declared here

test.cpp: In function 'int main()':

test.cpp:17:9: note: synthesized method 'constexpr B<0>::B()' first required

here 



I don't think a copy constructor of the member should be needed for the default

constructor of the containing struct.



The error disappears when I declare the latter explicitly, but not when I

declare it as "= default".



Is also disappears if struct B is not a template. I don't see why this should

make a difference.

Reply via email to