From -2061430046592664164
X-Google-Language: ENGLISH,ASCII-7-bit
X-Google-Thread: f78e5,8dda5aaabdd0a59f
X-Google-Attributes: gidf78e5,public
From: Tom Payne <thp@cs.ucr.edu>
Subject: Re: "int x = x;" or "T t(t);" is OK?
Date: 1996/11/01
Message-ID: <55b91v$7l4@skylark.ucr.edu>#1/1
X-Deja-AN: 193724503
references: <558kj7$iil@toralf.uib.no> <55ah0g$1gp0@news.rchland.ibm.com>
x-original-date: 31 Oct 1996 22:26:07 GMT
organization: University of California, Riverside
x-auth: PGPMoose V1.1 PGP comp.std.c++
newsgroups: comp.std.c++
originator: fjh@mundook.cs.mu.OZ.AU


Bill Seurer <seurer@rchland.ibm.com> wrote:
: In article <558kj7$iil@toralf.uib.no>, boukanov@sentef2.fi.uib.no
: (Igor Boukanov) writes:
: |> From the current DWP point of view is it possible to write: 
: |> int x = x;
: |> T t(t); 
: |> 
: |> where T has copy constructor?
: |> 
: |> I found that many C++ compilers accept the code without any warnings. 
: |> And of cause very unfortunately from C point it is OK. 

: Semantically and syntactically they are correct but of course they are
: probably coding errors.  

I hope that the standard specifies that objects thus initialized have
indeterminate and possibly illegal values, so that their subsequent
use (other than assigning them legitimate values) yields undefined
behavior.

Tom Payne
---
[ comp.std.c++ is moderated.  To submit articles: try just posting with      ]
[ your news-reader.  If that fails, use mailto:std-c++@ncar.ucar.edu         ]
[ FAQ:      http://reality.sgi.com/employees/austern_mti/std-c++/faq.html    ]
[ Policy:   http://reality.sgi.com/employees/austern_mti/std-c++/policy.html ]
[ Comments? mailto:std-c++-request@ncar.ucar.edu                             ]



