This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [c++-concepts] template parameter constraints
- From: Andrew Sutton <andrew dot n dot sutton at gmail dot com>
- To: Gabriel Dos Reis <gdr at axiomatics dot org>
- Cc: gcc-patches at gcc dot gnu dot org, Jason Merrill <jason at redhat dot com>
- Date: Tue, 10 Sep 2013 20:47:10 -0400
- Subject: Re: [c++-concepts] template parameter constraints
- Authentication-results: sourceware.org; auth=none
- References: <CANq5Syvz30we_-zMhCt7pJCZk9X-qAdh3iyG16bCZaHNTnrB7Q at mail dot gmail dot com> <8738pccjw7 dot fsf at euclid dot axiomatics dot org>
Will amend and commit tomorrow morning!
Andrew
Andrew Sutton
On Tue, Sep 10, 2013 at 7:54 PM, Gabriel Dos Reis <gdr@axiomatics.org> wrote:
> Andrew Sutton <andrew.n.sutton@gmail.com> writes:
>
> | I added a new macro to replace the use of TREE_TYPE to get
> | constraints. It's called TEMPLATE_PARMS_CONSTRAINTS. Patch attached:
> |
> | 2013-09-10 Andrew Sutton <andrew.n.sutton@gmail.com>
> | * gcc/cp/cp-tree.h (TEMPLATE_PARMS_CONSTRAINTS): New.
> | * gcc/cp/parser.c (cp_parser_template_declaration_after_export),
> | (cp_parser_type_parameter): Use TEMPLATE_PARMS_CONSTRAINTS.
> | * gcc/cp/semantics.c (fixup_template_scope): Use
> | TEMPLATE_PARMS_CONSTRAINTS.
>
> | +// Access template constraints associated with the template
> | +// parameter lists. Template parameter constraints are stored in
> | +// the TREE_TYPE of list.
>
> Hmm, we can have several levels of template parameter list. What about:
>
> // Logical constraints on the template parameters introduced at a
> // given template parameter list level indicated by NODE.
>
> Patch OK with that change.
>
> Thanks,
>
> -- Gaby