public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c++/55249] New: Multiple copy constructors for template class lead to link errors
@ 2012-11-09 10:24 antoshkka at gmail dot com
  2012-11-09 10:25 ` [Bug c++/55249] " antoshkka at gmail dot com
                   ` (12 more replies)
  0 siblings, 13 replies; 14+ messages in thread
From: antoshkka at gmail dot com @ 2012-11-09 10:24 UTC (permalink / raw)
  To: gcc-bugs


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: unassigned@gcc.gnu.org
        ReportedBy: antoshkka@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;
}


^ permalink raw reply	[flat|nested] 14+ messages in thread

end of thread, other threads:[~2012-12-07  5:16 UTC | newest]

Thread overview: 14+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-11-09 10:24 [Bug c++/55249] New: Multiple copy constructors for template class lead to link errors antoshkka at gmail dot com
2012-11-09 10:25 ` [Bug c++/55249] " antoshkka at gmail dot com
2012-11-09 10:53 ` paolo.carlini at oracle dot com
2012-11-09 12:21 ` markus at trippelsdorf dot de
2012-11-09 12:28 ` antoshkka at gmail dot com
2012-11-09 12:54 ` paolo.carlini at oracle dot com
2012-11-09 13:42 ` [Bug c++/55249] [4.6/4.7/4.8 Regression] " paolo.carlini at oracle dot com
2012-11-10  3:59 ` pinskia at gcc dot gnu.org
2012-12-06 16:12 ` rguenth at gcc dot gnu.org
2012-12-06 20:00 ` jason at gcc dot gnu.org
2012-12-07  4:54 ` jason at gcc dot gnu.org
2012-12-07  4:59 ` jason at gcc dot gnu.org
2012-12-07  5:13 ` jason at gcc dot gnu.org
2012-12-07  5:16 ` jason at gcc dot gnu.org

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).