[patch] Fix PR c++/27315: ICE in do_decl_instantiation, at cp/pt.c

Volker Reichelt reichelt@igpm.rwth-aachen.de
Mon May 15 16:46:00 GMT 2006


On 14 May, Mark Mitchell wrote:
> Volker Reichelt wrote:
> 
>> But we don't check for decl being error_mark_node here, although
>> grokdeclarator also returns error_mark_node to indicate errors.
>> Consequently, we ICE later.
> 
> In fact, grokdeclarator *should* always return error_mark_node to
> indicate error; the fact that it still returns NULL_TREE and/or
> void_type_node sometimes is just lingering nastiness.  It would be hard
> to justify a patch to fix that globally in Stage 3, but if it happened
> to fix a regression ...

I just gave it a try:
I replaced all 10 occurrences of "return void_type_node;" and
"return NULL_TREE;" by "return error_mark_node;" in grokdeclarator.
This survived bootstrap and caused no new regressions (well the
libstdc++-v3 testsuite is still running, but let's hope for the best).
And this really fixes a regression, namely PR 27398!

Would you consider this for inclusion, if I posted a complete patch?

One could probably do some clean-up in the callers of grokdeclarator
in stage 1 (eliminate tests for NULL_TREE or void_type_nodes).

Regards,
Volker




More information about the Gcc-patches mailing list