Go to file
Dodji Seketeli 6f1abb06a6 Restore canonical type comparison for dependent type(def)s
This patch restores canonical type comparison for dependent types and
then dependent typedefs. After this patch, two template type
parameters T are equal if they have the same index, level, *and*
number of sibling parameters. The novelty is to take in account the
number of sibling parameters.

To do this we first build the template parameters w/o taking in
account their number of siblings. When we know the number of template
parameters we fix up each template parameter with the number of
slibling parameters and we build the appropriate canonical types
accordingly. The patch fixes the fallouts deemed necessary.

This fixes PR c++/45606 but actually fixes all the previous bugs
related to dependent typedef comparison we had since we started to
properly representing dependent typedefs.

gcc/cp/ChangeLog:
	PR c++/45606
	* cp-tree.h (TEMPLATE_TYPE_PARM_SIBLING_PARMS): Remove.
	(struct template_parm_index_s)<num_siblings>: New field.
	(TEMPLATE_PARM_NUM_SIBLINGS): New accessor.
	(process_template_parm): Extend the API to accept the number of
	template parms in argument.
	(cp_set_underlying_type): Remove this.
	* class.c (build_self_reference): Require canonical type equality
	back on the self reference of class.
	* decl2.c (grokfield): Require canonical type equality back on
	typedef class fields.
	* name-lookup.c (pushdecl_maybe_friend): Require canonical type
	equality back on typedefs.
	* parser.c (cp_parser_template_parameter_list): Do not require
	canonical type equality on dependent types created during
	template parameters parsing.
	* pt.c (fixup_template_type_parm_type, fixup_template_parm_index)
	(fixup_template_parm, fixup_template_parms): New private
	functions.
	(current_template_args): Declare this.
	(process_template_parm): Pass the total number of template parms
	to canonical_type_parameter.
	(build_template_parm_index): Add a new argument to carry the total
	number of template parms.
	(reduce_template_parm_level, process_template_parm, make_auto): Adjust.
	(current_template_args): Fix this for template template
	parameters.
	(tsubst_template_parm): Split out of ...
	(tsubst_template_parms): ... this.
	(reduce_template_parm_level): Don't loose
	TEMPLATE_PARM_NUM_SIBLINGS when cloning a TEMPLATE_PARM_INDEX.
	(template_parm_to_arg): Extracted this function from
	current_template_args. Make it represent invalid template parms
	with an error_mark_node instead of a LIST_TREE containing an
	error_mark_node.
	(current_template_args): Use template_parm_to_arg.
	(dependent_template_arg_p): Consider an invalid template argument
	as dependent.
	(end_template_parm_list): Do not update template sibling parms
	here anymore. Use fixup_template_parms instead.
	(process_template_parm): Pass the number of template parms to
	canonical_type_parameter.
	(make_auto): Require structural equality on auto
	TEMPLATE_TYPE_PARM for now.
	(unify)<BOUND_TEMPLATE_TEMPLATE_PARM>: Coerce template parameters
	using all the arguments deduced so far.
	(tsubst)<TEMPLATE_TYPE_PARM>: Pass the number of sibling parms to
	canonical_type_parameter.
	* tree.c (cp_set_underlying_type): Remove.
	* typeck.c (get_template_parms_of_dependent_type)
	(incompatible_dependent_types_p): Remove.
	(structural_comptypes): Do not call incompatible_dependent_types_p
	anymore.
	(comp_template_parms_position): Re-organized. Take the length of
	template parms list in account.

gcc/testsuite/ChangeLog:
	PR c++/45606
	* g++.dg/template/typedef36.C: New test.
	* gcc/testsuite/g++.dg/template/canon-type-9.C: Likewise.
	* g++.dg/template/canon-type-10.C: Likewise.
	* g++.dg/template/canon-type-11.C: Likewise.
	* g++.dg/template/canon-type-12.C: Likewise.
	* g++.dg/template/canon-type-13.C: Likewise.

From-SVN: r166179
2010-11-02 13:44:19 +01:00
INSTALL
boehm-gc configure: Regenerate. 2010-10-28 22:37:36 +00:00
config Fix unportable shell quoting. 2010-09-27 20:19:41 +00:00
contrib Remove gccbug 2010-10-18 09:39:15 +00:00
fixincludes re PR c++/46024 (g++.dg/warn/miss-format-1.C FAILs on Solaris 8 and 9) 2010-10-20 17:36:15 +00:00
gcc Restore canonical type comparison for dependent type(def)s 2010-11-02 13:44:19 +01:00
gnattools re PR ada/42659 (gnatmake thinks libraries aren't supported) 2010-01-09 18:21:52 +00:00
include Sync LD plugin patch series (part 1/6) with src/include/. 2010-10-15 07:39:07 +00:00
intl Fix unportable shell quoting. 2010-09-27 20:19:41 +00:00
libada Makefile.in (GNATLIBCFLAGS_FOR_C): New variable. 2009-10-24 10:58:31 +00:00
libcpp * cpplib.pot: Regenerate. 2010-10-22 15:50:24 +01:00
libdecnumber cppbuiltin.c (define_builtin_macros_for_type_sizes): Define __BYTE_ORDER__... 2010-10-23 03:05:47 +00:00
libffi Add ARM VFP ABI support to libffi. 2010-10-28 18:11:11 +00:00
libgcc cppbuiltin.c (define_builtin_macros_for_type_sizes): Define __BYTE_ORDER__... 2010-10-23 03:05:47 +00:00
libgfortran re PR fortran/46010 (I/O: Namelist-reading bug) 2010-10-26 19:05:08 +00:00
libgomp futex.h: New. 2010-10-06 16:42:50 +00:00
libiberty setproctitle.c: Add space after function name in @deftypefn comment. 2010-10-29 23:09:50 +00:00
libjava GNU Classpath import (libgcj-snapshot-20100921). 2010-10-12 15:55:12 +00:00
libmudflap re PR testsuite/20003 (libmudflap.cth timeouts too short) 2010-10-31 22:04:20 -04:00
libobjc Makefile.in (OBJC_SOURCE_FILES): Added accessors.m. 2010-10-24 17:23:19 +00:00
libssp configure.ac (gfortran_use_symver): Only check for Sun-style symbol versioning on Solaris 2. 2010-07-02 16:17:04 +00:00
libstdc++-v3 libstdc++: N3126 draft support. 2010-11-01 22:35:28 -04:00
lto-plugin lto-plugin.c (dump_symtab): Correct printf argument type. 2010-10-11 16:14:54 +02:00
maintainer-scripts gcc_release (snapshot_print): Also include an sha1 hash for every tarball. 2010-08-23 18:52:06 +00:00
zlib Update to Automake 1.11.1. 2010-04-02 18:18:06 +00:00
ABOUT-NLS
COPYING
COPYING.LIB
COPYING.RUNTIME Licensing changes to GPLv3 resp. GPLv3 with GCC Runtime Exception. 2009-04-09 17:00:19 +02:00
COPYING3 COPYING_v3: New file. 2007-07-17 08:37:53 +00:00
COPYING3.LIB COPYING_v3: New file. 2007-07-17 08:37:53 +00:00
ChangeLog re PR libstdc++/12110 (ICE building 64-bit strstream.o) 2010-11-02 10:50:35 +10:30
ChangeLog.tree-ssa
MAINTAINERS * MAINTAINERS: Update my email address. 2010-10-23 13:27:20 -07:00
Makefile.def Makefile.def (target_modules): Set lib_path to src/.libs for libstdc++-v3 module. 2010-10-20 14:39:17 +00:00
Makefile.in Makefile.def (target_modules): Set lib_path to src/.libs for libstdc++-v3 module. 2010-10-20 14:39:17 +00:00
Makefile.tpl Makefile.def (target_modules): Set lib_path to src/.libs for libstdc++-v3 module. 2010-10-20 14:39:17 +00:00
README README: Refer to the various COPYING* files instead of just COPYING. 2009-10-10 20:59:49 +00:00
compile Update automake-provided files in the toplevel. 2009-08-22 11:47:16 +00:00
config-ml.in config-ml.in: don't handle --enable-shared and --enable-static. 2008-05-14 17:15:51 +00:00
config.guess config.sub: Update to version 2010-05-21. 2010-05-25 13:22:07 +00:00
config.rpath * config.rpath: Add AIX 6 support. 2008-03-13 14:55:20 -04:00
config.sub config.sub: Update to version 2010-05-21. 2010-05-25 13:22:07 +00:00
configure re PR libstdc++/12110 (ICE building 64-bit strstream.o) 2010-11-02 10:50:35 +10:30
configure.ac re PR libstdc++/12110 (ICE building 64-bit strstream.o) 2010-11-02 10:50:35 +10:30
depcomp Update automake-provided files in the toplevel. 2009-08-22 11:47:16 +00:00
install-sh Update automake-provided files in the toplevel. 2009-08-22 11:47:16 +00:00
libtool-ldflags re PR bootstrap/31906 ("-Xcompiler" is inserted after "-Xlinker" when building libstdc++) 2007-09-20 10:20:05 +00:00
libtool.m4 Sync from git Libtool and regenerate. 2009-12-05 17:18:53 +00:00
ltgcc.m4 libtool.m4: Update to libtool 2.2.6. 2008-09-26 16:21:02 +00:00
ltmain.sh Sync from git Libtool and regenerate. 2009-12-05 17:18:53 +00:00
ltoptions.m4 Sync from git Libtool and regenerate. 2009-12-05 17:18:53 +00:00
ltsugar.m4 libtool.m4: Update to libtool 2.2.6. 2008-09-26 16:21:02 +00:00
ltversion.m4 Sync from git Libtool and regenerate. 2009-12-05 17:18:53 +00:00
lt~obsolete.m4 Sync from git Libtool and regenerate. 2009-12-05 17:18:53 +00:00
missing Update automake-provided files in the toplevel. 2009-08-22 11:47:16 +00:00
mkdep
mkinstalldirs Update automake-provided files in the toplevel. 2009-08-22 11:47:16 +00:00
move-if-change Import from Autoconf sources: 2005-11-21 13:21:37 +11:00
symlink-tree
ylwrap Update automake-provided files in the toplevel. 2009-08-22 11:47:16 +00:00

README

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.