This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [c++-concepts] variable concepts
- From: Andrew Sutton <andrew dot n dot sutton at gmail dot com>
- To: Braden Obrzut <admin at maniacsvault dot net>
- Cc: gcc-patches <gcc-patches at gcc dot gnu dot org>, Jason Merrill <jason at redhat dot com>
- Date: Wed, 13 Aug 2014 08:25:52 -0400
- Subject: Re: [c++-concepts] variable concepts
- Authentication-results: sourceware.org; auth=none
- References: <53EB12C0 dot 9050208 at maniacsvault dot net>
Committed.
Andrew Sutton
On Wed, Aug 13, 2014 at 3:24 AM, Braden Obrzut <admin@maniacsvault.net> wrote:
> This patch adds support for variable concepts.
>
> There is a known issue that prevents concept variables from having requires
> expressions that have parameters. This issue is not within the scope of
> this patch as it affects adhoc requires expressions as well.
>
> 2014-08-13 Braden Obrzut <admin@maniacsvault.net>
>
> * gcc/cp/constraint.cc (deduce_constrained_parameter): Deduce concept
> from variable concept template-id expressions.
> (normalize_var): New.
> (normalize_template_id): Identify variable concepts.
> (build_concept_check): Handle variable concepts.
> (finish_shorthand_requirement): Handle variable concepts.
> (diagnose_var): New.
> (diagnose_node): Identify variable concepts.
> * gcc/cp/decl.c (grokvardecl): Pass concept flag through to
> check_explicit_specialization.
> (grokdeclarator): Allow variable concepts and pass concept flag through
> grokvardecl.
> * gcc/cp/parser.c (cp_is_constrained_parameter): Accept variable
> concepts.
> (cp_parser_nonclass_name): Accept variable concepts.
> (get_concept_from_constraint): Handle variable concepts.
> * gcc/cp/pt.c (tsubst_copy_and_build): Lookup variable templates.
> (value_dependent_expression_p): Check requires expressions for value
> dependence.
> * gcc/cp/semantics.c (finish_call_expr): Don't instantiate variable
> templates if processing a template declaration.
> * gcc/testsuite/g++.dg/concepts/decl-diagnose.C: Change expected error
> as variable concepts are now handled.
> * gcc/testsuite/g++.dg/concepts/var-concepts1.C: New test.
> * gcc/testsuite/g++.dg/concepts/var-concepts2.C: New test.
>