Nathan Sidwell <[EMAIL PROTECTED]> wrote: >>> In the C++ front end, default arguments are recorded in >>> FUNCTION_TYPEs intead of being part of the FUNCTION_DECLs. What are >>> the reasons for that? >> >> >> There used to be an extension that allowed default arguments on >> function pointer types. We agreed to kill it, although I don't know >> if it was actually removed. If that's been done, there's no longer >> any reason. > > I took it out the back and shot it. > > The obvious place is on the DECL_INITIAL of the PARM_DECLs, but I > don't think they exist until the function is defined.
I heard once that there was some long-term project of storing function declarations (without corresponding definitions) in a more memory-efficient memory representation. Moving default parameters within PARM_DECL seems a little backward in this respect. And if your memory is right, requiring to build PARM_DECLs just to store default arguments would be even worse. I understand this has to be done in a separate pass: I was just bringing up the issue so that, if possibile, we could find some place which does not conflict with that project. Giovanni Bajo