This is the mail archive of the gcc@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]

Re: a warning to implement


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


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