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++/15229] Omits constructor calls for variables not used otherwise.


------- Additional Comments From pinskia at gcc dot gnu dot org  2004-04-30 17:22 -------
Invalid, this code is equivent to this simplifed case:
struct Lingo
{
  Lingo ();
};
struct ALingo : Lingo
{
  ALingo();
};
int main()
{
  ALingo a;
  Lingo b(a); // <-- calls the copy constrctor
}

Since there is no user defined copy constructor, the compiler creates one for you (by the rules of C++).
So this is invalid, to solve this you need to define a copy constructor.

-- 
           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |RESOLVED
         Resolution|                            |INVALID


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


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