Patrick Palka 4023420086 c++: Normalize nested-requirements twice at parse time [PR97093]
The re-normalization performed from diagnose_nested_requirement doesn't
always work because we may have already lost the necessary template
context that determines the set of in-scope template parameters used by
the nested-requirement.  This leads to normalization producing atoms
that have incomplete/bogus parameter mappings, which breaks satisfaction.

To fix this, we could just use the normal form that we previously
computed at parse time, but this normal form lacks the diagnostic
information that leads to good error messages.

Instead, this patch makes diagnose_nested_requirement normalize twice at
parse time -- once without diagnostic information and once with -- so
that routines can use the "regular" normal form when performing
satisfaction quietly and the "diagnostic" normal form when performing
satisfaction noisily.  Moreover, this patch makes tsubst_nested_requirement
always first perform satisfaction quietly so that the satisfaction cache
can get consistently utilized.

This patch also adds some sanity checks to build_parameter_mapping that
would have caught the underlying bug sooner (and deterministically).

gcc/cp/ChangeLog:

	PR c++/97093
	* constraint.cc (parameter_mapping_equivalent_p): Add some
	sanity checks.  Clarify comment.
	(tsubst_nested_requirement): Always perform satisfaction
	quietly first.  If that yields an erroneous result, emit a
	context message and replay satisfaction noisily with the
	diagnostic normal form.
	(finish_nested_requirement): Normalize the constraint-expression
	twice, once with diagnostic information and once without.  Store
	them in a TREE_LIST within the TREE_TYPE.
	(diagnose_nested_requirement): When replaying satisfaction, use
	the diagnostic normal form instead of renormalizing on the spot.

gcc/testsuite/ChangeLog:

	PR c++/97093
	* g++.dg/cpp2a/concepts-requires22.C: New test.
2020-12-05 13:47:40 -05:00
2020-11-26 00:16:41 +00:00
2020-12-05 00:16:39 +00:00
2020-11-19 00:16:30 +00:00
2020-10-30 00:16:29 +00:00
2020-09-25 00:16:27 +00:00
2020-12-02 00:16:41 +00:00
2020-07-31 00:16:26 +00:00
2020-12-04 00:16:36 +00:00
2020-11-26 00:16:41 +00:00
2020-11-30 00:16:27 +00:00
2020-11-30 00:16:27 +00:00
2020-05-30 00:16:27 +00:00
2020-01-15 14:29:53 +01:00
2020-12-02 11:04:01 -07:00
2020-12-03 00:16:47 +00:00

This directory contains the GNU Compiler Collection (GCC).

The GNU Compiler Collection is free software.  See the files whose
names start with COPYING for copying permission.  The manuals, and
some of the runtime libraries, are under different terms; see the
individual source files for details.

The directory INSTALL contains copies of the installation information
as HTML and plain text.  The source of this information is
gcc/doc/install.texi.  The installation information includes details
of what is included in the GCC sources and what files GCC installs.

See the file gcc/doc/gcc.texi (together with other files that it
includes) for usage and porting information.  An online readable
version of the manual is in the files gcc/doc/gcc.info*.

See http://gcc.gnu.org/bugs/ for how to report bugs usefully.

Copyright years on GCC source files may be listed using range
notation, e.g., 1987-2012, indicating that every year in the range,
inclusive, is a copyrightable year that could otherwise be listed
individually.
Description
No description provided
Readme 2.1 GiB
Languages
C++ 31.9%
C 31.3%
Ada 12%
D 6.5%
Go 6.4%
Other 11.5%