Path: utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!asuvax!ncar!elroy.jpl.nasa.gov!usc!samsung!know!pluto.hemel.bull.co.uk!pmoore From: pmoore@hemel.bull.co.uk (Paul Moore) Newsgroups: comp.lang.c++ Subject: conditional scope and destrcutors (part 3) Message-ID: <1991Jan30.124321.17051@hemel.bull.co.uk> Date: 30 Jan 91 12:43:21 GMT Organization: Bull HN UK Lines: 22 I know that this was thrashed out in previous traffic but I thought I would repost as I have just been bitten again, this time in a different construct and again it took me a long time to sort it out (its probably due to my programming style of declaring things near to where I need them). ..... switch(n) { case a: Class object; case b: ...... } If case b is done then Zortech 2.1 calls the destructor for object even though it has not bee constructed. The general concensus was that this is a programming bug that should be fatalled by the compiler (cfront does fatal it) - it should certainly issue a warning - Zortech silently accepts it. (I am sending a copy of this to ztc-bugs)