Use satisfaction with nested requirements.
authorJason Merrill <jason@gcc.gnu.org>
Thu, 7 Nov 2019 00:21:44 +0000 (19:21 -0500)
committerJason Merrill <jason@gcc.gnu.org>
Thu, 7 Nov 2019 00:21:44 +0000 (19:21 -0500)
commit81a34a6b68184436726489b81d44267c40f6fbe7
tree515b593df7589864ce653e94ad2328ffcdd2b507
parent67568e1ad4d5623ac2c238b10fddf0faaa1fa70c
Use satisfaction with nested requirements.

gcc/cp/

2019-11-06  Andrew Sutton  <asutton@lock3software.com>

* constraint.cc (build_parameter_mapping): Use
current_template_parms when the declaration is not available.
(norm_info::norm_info) Make explicit.
(normalize_constraint_expression): Factor into a separate overload
that takes arguments, and use that in the original function.
(tsubst_nested_requirement): Use satisfy_constraint instead of
trying to evaluate this as a constant expression.
(finish_nested_requirement): Keep the normalized constraint and the
original normalization arguments with the requirement.
(diagnose_nested_requirement): Use satisfy_constraint. Tentatively
implement more comprehensive diagnostics, but do not enable.
* parser.c (cp_parser_requires_expression): Relax requirement that
requires-expressions can live only inside templates.
* pt.c (any_template_parm_r): Look into type of PARM_DECL.

2019-11-06  Jason Merrill  <jason@redhat.com>

* pt.c (use_pack_expansion_extra_args_p): Still do substitution if
all packs are simple pack expansions.
(add_extra_args): Check that the extra args aren't dependent.

gcc/testsuite/
* lib/prune.exp: Ignore "in requirements" in diagnostics.
* g++.dg/cpp2a/requires-18.C: New test.
* g++.dg/cpp2a/requires-19.C: New test.

From-SVN: r277900
gcc/cp/ChangeLog
gcc/cp/constraint.cc
gcc/cp/parser.c
gcc/cp/pt.c
gcc/testsuite/g++.dg/cpp2a/concepts-requires18.C [new file with mode: 0644]
gcc/testsuite/g++.dg/cpp2a/concepts-requires19.C [new file with mode: 0644]
gcc/testsuite/lib/prune.exp