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: [C++ PATCH] Fix up DECL_ARG_TYPE (PR c++/36631)


Mark Mitchell wrote:
That may be -- but I think the basic point remains true.  DECL_ARG_TYPE
is not a front-end concept.  It's an implementation detail, describing
how exactly the argument is passed.  As such, it really should be left
to the middle-end to compute as needed.

Well, it depends on the ABI, which can be language-specific.


The issue is much like the one that motivated complete_vars: we can treat a class as complete while we're in the middle of the definition, but when we're done defining the class we need to go back and fix up the places which really need bits that we don't know until after finish_struct. That can be done either toward the end of finish_struct, as with complete_vars, or as needed later on. For functions being defined, we update DECL_ARG_TYPE as part of start_function (require_complete_type_for_parms). Gimplification seems to be a fine time to do this for called functions.

I don't think this issue is specific to templates, however; the example in one of Jakub's mails

struct C
{
  C ();
  void foo (C, C);
};

void bar (void)
{
  C c;
  c.foo (c, c);
}

I would expect to have the same problem.

Jason


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