mirror of
git://gcc.gnu.org/git/gcc.git
synced 2025-04-08 18:51:00 +08:00
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.
…
…
…
…
…
…
…
…
…
…
…
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
Languages
C++
31.9%
C
31.3%
Ada
12%
D
6.5%
Go
6.4%
Other
11.5%