g++ rejects legal?
Giovanni Bajo
giovannibajo@libero.it
Thu Nov 4 14:04:00 GMT 2004
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
:)
Giovanni Bajo
More information about the Gcc
mailing list