This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug c++/41216] G++ failed to correctly resolve the template parameters.



------- Comment #3 from paolo dot carlini at oracle dot com  2009-09-01 20:06 -------
As a matter of fact, this snippet doesn't link:

struct Inner
{
  Inner()
  : data(0) {}

  template<class IStream>
    explicit Inner(IStream&);

  int data;
};

int f()
{
  Inner inner1;
  Inner inner2(inner1);
}

Now, as a matter of fact, the fact that the above code doesn't link means that
Inner isn't CopyConstructible (First line of Table 30 in C++03), thus, it is
invalid to instantiate std::vector with it, as you are doing in Outter. I'm
adding Jason in CC just in case he has something to say about the C++ proper
issue.


-- 

paolo dot carlini at oracle dot com changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |jason at gcc dot gnu dot org
             Status|UNCONFIRMED                 |RESOLVED
          Component|libstdc++                   |c++
         Resolution|                            |INVALID


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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]