Go to file
Dodji Seketeli 2870428932 PR c++/45114 - Support C++11 alias-declaration
gcc/cp/

	* cp-tree.h (TYPE_DECL_ALIAS_P, TYPE_ALIAS_P)
	(DECL_TYPE_TEMPLATE_P, DECL_ALIAS_TEMPLATE_P): New accessor
	macros.
	(TYPE_TEMPLATE_INFO): Get template info of an alias template
	specializations from its TYPE_DECL.
	(SET_TYPE_TEMPLATE_INFO): Set template info of alias template
	specializations into its TYPE_DECL.
	(DECL_CLASS_TEMPLATE_P): Re-write using the new
	DECL_TYPE_TEMPLATE_P.
	(enum cp_decl_spec): Add new ds_alias enumerator.
	(alias_type_or_template_p, alias_template_specialization_p):
	Declare new functions.
	* parser.c (cp_parser_alias_declaration): New static function.
	(cp_parser_check_decl_spec): Add "using" name for the `alias'
	declspec.
	(cp_parser_type_name): Update comment.  Support simple-template-id
	representing alias template specializations in c++0x mode.
	(cp_parser_qualifying_entity): Update comment.  Use
	cp_parser_type_name.
	(cp_parser_block_declaration): Handle alias-declaration in c++11.
	Update comment.
	(cp_parser_template_id): Handle specializations of alias
	templates.
	(cp_parser_member_declaration): Add alias-declaration production
	to comment.  Support alias-declarations.
	(cp_parser_template_declaration_after_export): Handle alias
	templates in c++11.
	* decl.c (make_typename_type, make_unbound_class_template): Accept
	alias templates.
	(grokdeclarator): Set TYPE_DECL_ALIAS_P on alias
	declarations.
	* decl2.c (grokfield): Move template creation after setting up the
	TYPE_DECL of the alias, so that the TEMPLATE_DECL of the alias
	template actually carries the right type-id of the alias
	declaration.
	* pt.c (alias_type_or_template_p)
	(alias_template_specialization_p): Define new public functions.
	(maybe_process_partial_specialization): Reject partial
	specializations of alias templates.
	(primary_template_instantiation_p): Consider alias template
	instantiations.
	(push_template_decl_real): Assert that TYPE_DECLs of alias
	templates are different from those of class template.  Store
	template info onto the TYPE_DECL of the alias template.
	(convert_template_argument): Strip aliases from template
	arguments.
	(lookup_template_class_1): Handle the creation of the
	specialization of an alias template.
	(tsubst_decl): Create a substituted copy of the TYPE_DECL of an
	member alias template.
	(tsubst): Handle substituting into the type of an alias template.
	Handle substituting UNBOUND_CLASS_TEMPLATE into
	BOUND_TEMPLATE_TEMPLATE_PARM.
	(do_type_instantiation): Better diagnostics when trying to
	explicitely instantiate a non-class template.
	* search.c (lookup_field_1, lookup_field_r): Support looking up
	alias templates.
	* semantics.c (finish_template_type): For instantiations of alias
	templates, return the TYPE_DECL of the actual alias and not the
	one of the aliased type.
	* error.c (dump_alias_template_specialization): New static
	function.
	(dump_type): Handle printing of alias templates and their
	specializations.  templates.
	(dump_aggr_type): For specialization of alias templates, fetch
	arguments from the right place.
	(dump_decl): Print an alias-declaration like `using decl = type;'
	(dump_template_decl):  Support printing of alias templates.

gcc/testsuite/

	* g++.dg/cpp0x/alias-decl-0.C: New test case.
	* g++.dg/cpp0x/alias-decl-1.C: Likewise.
	* g++.dg/cpp0x/alias-decl-3.C: Likewise.
	* g++.dg/cpp0x/alias-decl-4.C: Likewise.
	* g++.dg/cpp0x/alias-decl-6.C: Likewise.
	* g++.dg/cpp0x/alias-decl-7.C: Likewise.
	* g++.dg/cpp0x/alias-decl-8.C: Likewise.
	* g++.dg/cpp0x/alias-decl-9.C: Likewise.
	* g++.dg/cpp0x/alias-decl-10.C: Likewise.
	* g++.dg/ext/alias-decl-attr1.C: Likewise.
	* g++.dg/ext/alias-decl-attr2.C: Likewise.
	* g++.dg/ext/alias-decl-attr3.C: Likewise.
	* g++.dg/ext/alias-decl-attr4.C: Likewise.

From-SVN: r181118
2011-11-07 22:28:50 +01:00
boehm-gc configure.ac (THREADS): Remove posix95. 2011-08-08 15:39:35 +00:00
config Move libgcc2 to toplevel libgcc 2011-11-02 15:23:48 +00:00
contrib config.gcc (epiphany-*-*): New architecture. 2011-11-05 20:48:23 +00:00
fixincludes re PR lto/48851 (lto-plugin.c:224:7: error: missing sentinel in function call [-Werror=format]) 2011-10-25 20:07:19 +00:00
gcc PR c++/45114 - Support C++11 alias-declaration 2011-11-07 22:28:50 +01:00
gnattools Makefile.in (LOOSE_WARN): Delete. 2011-10-12 22:41:57 +00:00
include obstack.h [!GNUC] (obstack_free): Avoid cast to int. 2011-10-21 21:35:29 -04:00
INSTALL
intl Fix unportable shell quoting. 2010-09-27 20:19:41 +00:00
libada Makefile.in (LOOSE_WARN): Delete. 2011-10-12 22:41:57 +00:00
libcpp re PR bootstrap/50857 (The compiler is built with exceptions and RTTI enabled) 2011-11-03 17:17:07 +00:00
libdecnumber remove useless if-before-free tests 2011-04-20 18:19:03 +00:00
libffi re PR libffi/49594 (bootstrap failure in libffi:darwin_closure for powerpc-darwin8) 2011-09-04 19:19:39 +00:00
libgcc libgcov.c (struct gcov_fn_buffer): New struct. 2011-11-07 18:14:46 +00:00
libgfortran Revert previous fix for PR 45723. 2011-11-07 16:32:50 +02:00
libgo syscall: Remove Linux system calls not available in older glibcs. 2011-11-02 17:53:20 +00:00
libgomp posix95: Remove empty directory. 2011-10-10 19:27:31 +00:00
libiberty re PR c++/48370 (G++ fails to extend reference temporary lifetime in some situations) 2011-11-04 08:54:08 -04:00
libjava exception.cc (parse_lsda_header): hardcode ttype_encoding for older ARM EABI toolchains. 2011-10-20 13:56:12 +00:00
libmudflap re PR middle-end/43513 (The stack pointer is adjusted twice) 2011-07-31 10:02:12 +00:00
libobjc Move gthr to toplevel libgcc 2011-11-02 15:28:43 +00:00
libquadmath Move libgcc2 to toplevel libgcc 2011-11-02 15:23:48 +00:00
libssp re PR bootstrap/48135 (build fails on Solaris2.8 due to Glob.pm not found within /usr/perl5) 2011-03-21 12:24:17 +00:00
libstdc++-v3 atomic_base.h (atomic_thread_fence): Call builtin. 2011-11-07 20:06:39 +00:00
lto-plugin re PR lto/47247 (Linker plugin specification makes it difficult to handle COMDATs) 2011-10-02 10:41:24 +00:00
maintainer-scripts update_version_svn (IGNORE_BRANCHES): Add gcc-4_3-branch. 2011-06-27 11:05:50 +00:00
zlib Remove freebsd1 from libtool.m4 macros and config.rpath. 2011-02-13 11:45:53 +00:00
ABOUT-NLS
ChangeLog Move libgcc2 to toplevel libgcc 2011-11-02 15:23:48 +00:00
ChangeLog.tree-ssa
compile
config-ml.in MAINTAINERS (crx port, [...]): Remove. 2011-03-22 19:58:18 +00:00
config.guess oops - omitted from previous delta. 2011-06-06 10:34:35 +00:00
config.rpath Remove freebsd1 from libtool.m4 macros and config.rpath. 2011-02-13 11:45:53 +00:00
config.sub * config.sub: Update to version 2011-10-29 (added rl78) 2011-11-01 20:56:32 -04:00
configure configure.ac (tic6x-*-*): Remove gdb from noconfigdirs. 2011-08-14 12:25:15 +00:00
configure.ac configure.ac (tic6x-*-*): Remove gdb from noconfigdirs. 2011-08-14 12:25:15 +00:00
COPYING
COPYING3
COPYING3.LIB
COPYING.LIB
COPYING.RUNTIME
depcomp
install-sh
libtool-ldflags
libtool.m4 Remove freebsd1 from libtool.m4 macros and config.rpath. 2011-02-13 11:45:53 +00:00
lt~obsolete.m4 Sync from git Libtool and regenerate. 2009-12-05 17:18:53 +00:00
ltgcc.m4
ltmain.sh backport: ltmain.sh (relink): Use absolute path when hardcoding with -L. 2011-01-13 18:51:10 +00:00
ltoptions.m4 Sync from git Libtool and regenerate. 2009-12-05 17:18:53 +00:00
ltsugar.m4
ltversion.m4 Sync from git Libtool and regenerate. 2009-12-05 17:18:53 +00:00
MAINTAINERS * MAINTAINERS (Write After Approval): Add myself. 2011-10-25 09:39:49 +00:00
Makefile.def Makefile.def (language=c++): Add check-c++0x and check-target-libmudflap-c++. 2011-07-16 23:34:13 -04:00
Makefile.in Move libgcc2 to toplevel libgcc 2011-11-02 15:23:48 +00:00
Makefile.tpl Move libgcc2 to toplevel libgcc 2011-11-02 15:23:48 +00:00
missing
mkdep
mkinstalldirs
move-if-change Import move-if-change script from gnulib. 2011-02-12 15:48:30 +00:00
README README: Refer to the various COPYING* files instead of just COPYING. 2009-10-10 20:59:49 +00:00
symlink-tree
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.