Re: ISO C++ forbids initialization in array new?

2005-08-19 Thread Alisdair Meredith
WU Yongwei wrote:

> Well, I see this in the gcc error message.  Can someone here kindly
> point to me which part of the Standard specified this behaviour?  I
> thought it should be in 5.3.4, but was not able to find the words
> there.
> 
> By the way, anyone knows the rationale of this behaviour?

It is not explicitly forbidden. Rather, there is no syntax defined that
would enable it (so it is implicitly forbidden)

you might be interested in the following paper from the last ISO
mailing ;¬)

http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2005/n1824.htm


AlisdairM



Re: constructors and multiple entry points

2005-09-24 Thread Alisdair Meredith
Gabriel Dos Reis wrote:

> The issue was whether GNU g++ uses it as an *implementation detail*
> that will be affected if constructors suddenly became recursive.

I was not aware the proposal supported recursive constructors - in the
sense that the syntax I saw had no obvious way to terminate any
recursion.

OTOH, there is no requirement to detect recursion and make the program
malformed, merely a hidden bug waiting to strike your users.

AlisdairM



Re: constructors and multiple entry points

2005-09-24 Thread Alisdair Meredith
Gabriel Dos Reis wrote:

> I know the proposals did not dig into all the corner cases -- and I
> don't even know whether they considered the case.  But, at some point,
> someone has to go through the sheer number of proposals and try to
> paint a global picture and see how they interact with existing
> implementation techniques; C++ is not known to be orthogonal :-)

Oh, we dug through that proposal quite thoroughly 

I specifically brought up the case of diagnosing recursion and making
it malformed.  The consensus was that while it was clearly a
programming error to write recursive ctors, no-one wanted to diagnose
recursive chains of calls, especially with all the other wonders we can
throw in to make 'indirect' recursion hard to detect.

It would be nice if there was a sop in there so that well-meaning
implementations could choose-but-not-be-required-to declare the easily
diagnosed cases malformed, but I don't think that got any support
either, as no-one was aware of anyone wanting to do this.

The point I forgot to make though, is that any program using recursive
constructors is broken, so I don't know how much it is worth worrying
about g++ implementation details for broken programs - it might be best
to just ignore the issue (so long as it does not produce new
compile/link time errors, and I don't think that is the case here)
 

AlisdairM