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



             Bug #: 55249

           Summary: Multiple copy constructors for template class lead to

                    link errors

    Classification: Unclassified

           Product: gcc

           Version: 4.6.3

            Status: UNCONFIRMED

          Severity: normal

          Priority: P3

         Component: c++

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

        ReportedBy: antosh...@gmail.com





Created attachment 28647

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

gcc -v -save-temps -std=c++0x -Wall -Wextra main.cpp 1>output.txt 2>&1



Following code leads to linker errors in C++11 mode and in default mode

(requires replacement of std::array with boost::array):



#include <array>

#include <vector>



template <class TypeT>

struct inner_type {



    inner_type() {}

    inner_type(inner_type& ) {}

    inner_type(const inner_type& ) {}



    ~inner_type() {}

};



// Uncomment typedef to get undefined reference to 

// __uninitialized_copyILb0EE13__uninit_copy

// Can be workaround by marking inner_type copy constructors with noexcept

//typedef std::vector<std::array<inner_type<int>, 3> > type;



// Uncomment typedef to get undefined reference to 

// `inner_type<int>::inner_type(inner_type<int> const&)'

//typedef std::array<inner_type<int>, 3> type;



int main()

{

    type t1;

    type t2 = t1;

    return 0;

}

Reply via email to