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++-concepts]: constraint association


Revisions from previous patch.

I've taken constraint_info out of lang_decl_min and made it specific
to TEMPLATE_DECLs by saving it as DECL_SIZE_UNIT. It seems to be
unused for templates. When I start working on the shorthand notation,
I'll do something similar for template parameters and auto
declarations.

The handling of non-template member functions also changes a little.
Here's a history of the revisions:

  - Current branch: the instantiated constraints are stored in
TEMPLATE_INFO and then checked in add_function_candidate.
  - Previous patch: instantiated constraints are associated directly
with the member functions' FUNCTION_DECL.
  - Current patch: constraints are only instantiated and checked at
the point of use.

The current patch will lead to redundant checks. I left a comment in
call.c explaining that we could use a bit in TEMPLATE_INFO to save
whether or not an instantiated declaration actually satisfies its
requirements.


Andrew



On Sat, Jun 22, 2013 at 6:43 PM, Gabriel Dos Reis <gdr@axiomatics.org> wrote:
> Andrew Sutton <andrew.n.sutton@gmail.com> writes:
>
> | > | But, I don't think we have a single TEMPLATE_PARM_DECL node. Template
> | > | parameters are either TYPE_DECLs or PARM_DECLs. I think auto
> | > | declarations, get VAR_DECLs, but I haven't looked closely at that
> | > | design. I'd have to look to see if there are any free tree slots all
> | > | of those decl nodes to minimize.
> | >
> | > The individual constraint for a template parameter should probably go
> | > with the TEMPLATE_PARM_INDEX which is the uniform representation of
> | > template parameters.  But, the real cumulative constraints go with the
> | > TEMPLATE_DECLs.  With Jason's patch that creates TEMPLATE_DECLs for
> | > partial instantiations, I believe we have all the bases covered.
> |
> | I have to look through the template parameter creation code, but that
> | sounds about right.
>
> build_template_parm    -- the real (low-level) constructor
> process_template_parm  -- higher-level interface to the parsing
> make_auto_1 -- for type of variables declared with 'auto'.
>
> -- Gaby
>



-- 
Andrew Sutton
andrew.n.sutton@gmail.com

Attachment: template-decl-2.patch
Description: Binary data


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