public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
From: "antoshkka at gmail dot com" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug c++/55249] New: Multiple copy constructors for template class lead to link errors
Date: Fri, 09 Nov 2012 10:24:00 -0000	[thread overview]
Message-ID: <bug-55249-4@http.gcc.gnu.org/bugzilla/> (raw)


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;
}


             reply	other threads:[~2012-11-09 10:24 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-11-09 10:24 antoshkka at gmail dot com [this message]
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

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=bug-55249-4@http.gcc.gnu.org/bugzilla/ \
    --to=gcc-bugzilla@gcc.gnu.org \
    --cc=gcc-bugs@gcc.gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).