]> git.ipfire.org Git - thirdparty/gcc.git/commit - gcc/cp/init.c
Implement C++11 non-static data member initializers.
authorJason Merrill <jason@redhat.com>
Sun, 25 Sep 2011 02:25:52 +0000 (22:25 -0400)
committerJason Merrill <jason@gcc.gnu.org>
Sun, 25 Sep 2011 02:25:52 +0000 (22:25 -0400)
commit0e5f8a598de1c8dc44fb59c6d0ea0dcd557f695a
treee73c67449ead609eb0ffca593088981be94efd13
parent77236534b98427544513ef4c159cbabdb333efd0
Implement C++11 non-static data member initializers.

* cp-tree.h (enum cpp_warn_str): Add CPP0X_NSDMI.
* error.c (maybe_warn_cpp0x): Handle it.
* call.c (convert_like_real) [ck_user]: Don't complain about
using an explicit constructor for direct-initialization.
* class.c (check_field_decl): Fix ancient typo.
(check_field_decls): NSDMIs make the default ctor non-trivial.
* decl.c (cp_finish_decl): Record NSDMI.
(grokdeclarator): Allow NSDMI.
* decl2.c (grokfield): Allow NSDMI.  Correct LOOKUP flags.
* init.c (perform_member_init): Use NSDMI.
* method.c (walk_field_subobs): Check for NSDMI.
* parser.c (cp_parser_member_declaration): Parse { } init.
* semantics.c (register_constexpr_fundef): Don't talk about
a return statement in a constexpr constructor.
(cxx_eval_call_expression): Check DECL_INITIAL instead of
DECL_SAVED_TREE.

From-SVN: r179155
17 files changed:
gcc/cp/ChangeLog
gcc/cp/call.c
gcc/cp/class.c
gcc/cp/cp-tree.h
gcc/cp/decl.c
gcc/cp/decl2.c
gcc/cp/error.c
gcc/cp/init.c
gcc/cp/method.c
gcc/cp/parser.c
gcc/cp/semantics.c
gcc/testsuite/ChangeLog
gcc/testsuite/g++.dg/cpp0x/nsdmi1.C [new file with mode: 0644]
gcc/testsuite/g++.dg/cpp0x/nsdmi2.C [new file with mode: 0644]
gcc/testsuite/g++.dg/cpp0x/nsdmi3.C [new file with mode: 0644]
gcc/testsuite/g++.dg/cpp0x/nsdmi4.C [new file with mode: 0644]
gcc/testsuite/g++.old-deja/g++.other/init4.C