Go to file
Patrick Palka 04b10596fe c++: Some preparatory type canonicalization fixes
The patches that follow revealed some latent type canonicalization
issues during normalization/satisfaction, due to normalization of
some constraint-expressions now being performed in different contexts
and more frequently (since the normalization caches get frequently
emptied in a checking compiler).  The issues are:

1. In tsubst_parameter_mapping, we canonicalize the arguments of a
   substituted TYPE_ARGUMENT_PACK only if the argument we started with
   wasn't a TYPE_ARGUMENT_PACK.  We should canonicalize a substituted
   TYPE_ARGUMENT_PACK regardless of what we started with.

2. We currently set DECL_CONTEXT and CONSTRAINT_VAR_P on each of the
   parameters introduced in a requires expression _after_ we're done
   processing the requirements.  But meanwhile we may have already
   built and computed the canonical form of a type that uses one of
   these PARM_DECLs (as say an operand to decltype).  But the canonical
   form depends on the result of cp_tree_equal, which in turn depends on
   the value of CONSTRAINT_VAR_P and DECL_CONTEXT.  So we must set these
   fields earlier, before processing requirements.

3. In do_auto_deduction, we use the result of finish_decltype_type later
   as a template argument, so we should canonicalize the result too.
   (While we're here, we should pass 'complain' to finish_decltype_type,
   which fixes the testcase auto1.C below.)

gcc/cp/ChangeLog:

	* constraint.cc (tsubst_parameter_mapping): Canonicalize the
	arguments of a substituted TYPE_ARGUMENT_PACK even if we've
	started with a TYPE_ARGUMENT_PACK.
	(finish_requires_expr): Don't set DECL_CONTEXT and
	CONSTRAINT_VAR_P on each of the introduced parameters here.
	* parser.c (cp_parser_requirement_parameter_list): Instead set
	these fields earlier, here.
	* pt.c (do_auto_deduction): Canonicalize the result of
	do_auto_deduction.  Pass 'complain' to finish_decltype_type.

gcc/testsuite/ChangeLog:

	* g++.dg/cpp1z/auto1.C: New test.
2021-03-02 07:38:37 -05:00
c++tools Daily bump. 2021-02-26 00:16:36 +00:00
config
contrib
fixincludes
gcc c++: Some preparatory type canonicalization fixes 2021-03-02 07:38:37 -05:00
gnattools
gotools
include
INSTALL
intl
libada
libatomic
libbacktrace
libcc1
libcody
libcpp
libdecnumber
libffi
libgcc Fix __sprintfkf prototype in libgcc. 2021-03-01 22:13:33 -05:00
libgfortran
libgo libgo: ensure memmove, memset 8 byte atomicity on ppc64x 2021-02-25 17:01:23 -08:00
libgomp Daily bump. 2021-02-28 00:16:18 +00:00
libhsail-rt
libiberty
libitm
libobjc
liboffloadmic
libphobos
libquadmath
libsanitizer
libssp
libstdc++-v3 Daily bump. 2021-02-28 00:16:18 +00:00
libvtv
lto-plugin
maintainer-scripts
zlib
.dir-locals.el
.gitattributes
.gitignore
ABOUT-NLS
ar-lib
ChangeLog
ChangeLog.jit
ChangeLog.tree-ssa
compile
config-ml.in
config.guess
config.rpath
config.sub
configure
configure.ac
COPYING
COPYING3
COPYING3.LIB
COPYING.LIB
COPYING.RUNTIME
depcomp
install-sh
libtool-ldflags
libtool.m4
lt~obsolete.m4
ltgcc.m4
ltmain.sh
ltoptions.m4
ltsugar.m4
ltversion.m4
MAINTAINERS
Makefile.def
Makefile.in
Makefile.tpl
missing
mkdep
mkinstalldirs
move-if-change
multilib.am
README
symlink-tree
test-driver
ylwrap

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.