g++ rejects legal?

Richard Guenther rguenth@tat.physik.uni-tuebingen.de
Thu Nov 4 14:18:00 GMT 2004


On Thu, 4 Nov 2004, Giovanni Bajo wrote:

> Richard Guenther wrote:
>
>
> > Ah, I see.  That makes sense.  Can this be detected (I'm sure it is,
> > or we would be endlessly looping(?)) and the diagnostic improved?
>
> Well, right now it works because of a trick (while instantiating a given type,
> we set the "complete" flag immediatly, so that if its instantiation is required
> recursively, the type is found to be complete but empty). I think this is
> implementation defined / undefined behaviour.
>
> Probably the diagnostic could be improved, yes. This would require having a
> temporary flag for each type saying "this type is being instantiated". If later
> we try to instantiated it again, we can bail out with the decent error message.
> You can file a diagnostic enhancement PR for this, but don't hold your breath
> :)

Done. PR c++/18296.

Richard.

--
Richard Guenther <richard dot guenther at uni-tuebingen dot de>
WWW: http://www.tat.physik.uni-tuebingen.de/~rguenth/



More information about the Gcc mailing list