a warning to implement

Gabriel Dos Reis gdr@codesourcery.com
Fri Feb 8 08:21:00 GMT 2002


Bernard Dautrevaux <Dautrevaux@microprocess.com> writes:

[...]

| > The following is OK:
| > 
| >   struct Node {
| >      Node* link;
| >      Node(Node& n) : link(&n) { }
| >   };
| > 
| >   int main()
| >   {
| >      T x = x;
| >   }
| > 
| > and is a canonical example of use for user-defined-type.
| 
| I think here we should REALLY had a warning; 

I'm of the opposite opinion.  Warning for what?

| in fact you have here a class which explicitely do NOT have a
| default constructor, 

So what?  

The class is defined to meet specific needs.  The default constructor
isn't part of that need.  So why should there be one?

| and then we create an 
| un-constructed object value. 

That is nonsense.

-- Gaby



More information about the Gcc mailing list