Path: utzoo!utgpu!jarvis.csri.toronto.edu!mailrus!ames!oliveb!apple!rutgers!att!ulysses!andante!alice!ark From: ark@alice.UUCP (Andrew Koenig) Newsgroups: comp.lang.c++ Subject: Re: cfront feature or bug? Message-ID: <9319@alice.UUCP> Date: 6 May 89 02:57:42 GMT References: Distribution: comp.lang.c++ Organization: AT&T Bell Laboratories, Liberty Corner NJ Lines: 32 In article , neath@solar-1.stars.flab.Fujitsu.JUNET writes: > if (k > 3) > X* t = new X[10]; > else > X* t = new X[20]; Cfront 2.0 will give an error message if you try to make a declaration the (only) subject of an if or else clause. It is far from clear what something like this should mean: if (x > 0) int y; Clearly, this cannot conditionally declare y in the surrounding context: how could one possibly compile this: if (x > 0) int y; y++; If you really want the declaration to live in a block of its own, you can still write if (x > 0) { int y; } and your meaning is then clear. -- --Andrew Koenig ark@europa.att.com