]> git.ipfire.org Git - thirdparty/gcc.git/commit
Implement C++11 inheriting constructors.
authorJason Merrill <jason@redhat.com>
Mon, 15 Oct 2012 07:32:03 +0000 (03:32 -0400)
committerJason Merrill <jason@gcc.gnu.org>
Mon, 15 Oct 2012 07:32:03 +0000 (03:32 -0400)
commit85b5d65a94c66fed37b29b04010b93fd13936219
tree8285868a5a9c87582ef3660e51cb5a55576cb450
parentd0d4f8c78e1b9d1038f0ec5fd0c59955dd1cc1f2
Implement C++11 inheriting constructors.

* cp-tree.h (cpp0x_warn_str): Add CPP0X_INHERITING_CTORS.
(DECL_INHERITED_CTOR_BASE, SET_DECL_INHERITED_CTOR_BASE): New.
(special_function_kind): Add sfk_inheriting_constructor.
* class.c (add_method): An inheriting ctor is hidden by a
user-declared one.
(one_inheriting_sig, one_inherited_ctor): New.
(add_implicitly_declared_members): Handle inheriting ctors.
* error.c (maybe_warn_cpp0x): Handle CPP0X_INHERITING_CTORS.
* init.c (emit_mem_initializers): Don't set LOOKUP_DEFAULTED
for an inheriting constructor.
* method.c (type_has_trivial_fn): Handle sfk_inheriting_constructor.
(type_set_nontrivial_flag): Likewise.
(add_one_base_init): Split out from...
(do_build_copy_constructor): ...here.  Handle inheriting constructors.
(locate_fn_flags): Handle a list of arg types.
(synthesized_method_walk): Handle inheriting constructors.
(maybe_explain_implicit_delete): Likewise.
(deduce_inheriting_ctor): New.
(implicitly_declare_fn): Handle inheriting constructors.
* name-lookup.c (push_class_level_binding_1): An inheriting constructor
does not declare the base's name.
(do_class_using_decl): Allow inheriting constructors.
* pt.c (template_parms_to_args): Split from current_template_args.
(add_inherited_template_parms): New.
(tsubst_decl): Handle inheriting constructors.
* tree.c (special_function_p): Handle inheriting constructors.

Co-Authored-By: Ville Voutilainen <ville.voutilainen@gmail.com>
From-SVN: r192448
23 files changed:
gcc/cp/ChangeLog
gcc/cp/class.c
gcc/cp/cp-tree.h
gcc/cp/error.c
gcc/cp/init.c
gcc/cp/method.c
gcc/cp/name-lookup.c
gcc/cp/pt.c
gcc/cp/tree.c
gcc/testsuite/ChangeLog
gcc/testsuite/g++.dg/cpp0x/inh-ctor1.C [new file with mode: 0644]
gcc/testsuite/g++.dg/cpp0x/inh-ctor10.C [new file with mode: 0644]
gcc/testsuite/g++.dg/cpp0x/inh-ctor11.C [new file with mode: 0644]
gcc/testsuite/g++.dg/cpp0x/inh-ctor12.C [new file with mode: 0644]
gcc/testsuite/g++.dg/cpp0x/inh-ctor13.C [new file with mode: 0644]
gcc/testsuite/g++.dg/cpp0x/inh-ctor2.C [new file with mode: 0644]
gcc/testsuite/g++.dg/cpp0x/inh-ctor3.C [new file with mode: 0644]
gcc/testsuite/g++.dg/cpp0x/inh-ctor4.C [new file with mode: 0644]
gcc/testsuite/g++.dg/cpp0x/inh-ctor5.C [new file with mode: 0644]
gcc/testsuite/g++.dg/cpp0x/inh-ctor6.C [new file with mode: 0644]
gcc/testsuite/g++.dg/cpp0x/inh-ctor7.C [new file with mode: 0644]
gcc/testsuite/g++.dg/cpp0x/inh-ctor8.C [new file with mode: 0644]
gcc/testsuite/g++.dg/cpp0x/inh-ctor9.C [new file with mode: 0644]