This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [PATCH] Fix PR c++/3882


>>>>> "Eric" == Eric Botcazou <ebotcazou@libertysurf.fr> writes:

> Ok, but there is a chicken-and-egg problem: the line that sets DECL_INITIAL
> to error_mark_node depends upon the result of the substitution of 'init'.

No, it doesn't; it only relies on whether or not init is set to something.
The substitution will only change what that something is.

Looking more closely, it seems that if we just move the init-setting code
later, the PRETTY_FUNCTION case will be broken, as in that case we set init
from DECL_INITIAL, which we will have just set to error_mark_node.  The fix
for this, IMO, is to move the code to generate the PRETTY_FUNCTION
initializer from tsubst_decl to here.

> If you are telling me that it is safe to test 'init' before it gets
> substituted, then I'll post the simplified fix.

Please.

Jason


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]