Implement C++11 inheriting constructors.
commitfa6e8832986fe3f02a3205d67728e761f0eb2c77
authorjason <jason@138bc75d-0d04-0410-961f-82ee72b054a4>
Mon, 15 Oct 2012 07:32:03 +0000 (15 07:32 +0000)
committerjason <jason@138bc75d-0d04-0410-961f-82ee72b054a4>
Mon, 15 Oct 2012 07:32:03 +0000 (15 07:32 +0000)
tree8285868a5a9c87582ef3660e51cb5a55576cb450
parent22596ff5772afba807624c631bc7713eb9f33426
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.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@192448 138bc75d-0d04-0410-961f-82ee72b054a4
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]