diff options
author | Jason Merrill <jason@redhat.com> | 2011-09-24 22:25:52 -0400 |
---|---|---|
committer | Jason Merrill <jason@gcc.gnu.org> | 2011-09-24 22:25:52 -0400 |
commit | 0e5f8a598de1c8dc44fb59c6d0ea0dcd557f695a (patch) | |
tree | e73c67449ead609eb0ffca593088981be94efd13 /gcc/cp/parser.c | |
parent | 77236534b98427544513ef4c159cbabdb333efd0 (diff) | |
download | gcc-0e5f8a598de1c8dc44fb59c6d0ea0dcd557f695a.zip gcc-0e5f8a598de1c8dc44fb59c6d0ea0dcd557f695a.tar.gz gcc-0e5f8a598de1c8dc44fb59c6d0ea0dcd557f695a.tar.bz2 |
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
Diffstat (limited to 'gcc/cp/parser.c')
-rw-r--r-- | gcc/cp/parser.c | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/gcc/cp/parser.c b/gcc/cp/parser.c index 2283312..bd46af3 100644 --- a/gcc/cp/parser.c +++ b/gcc/cp/parser.c @@ -18202,6 +18202,12 @@ cp_parser_member_declaration (cp_parser* parser) /* Parse the initializer. */ initializer = cp_parser_constant_initializer (parser); } + else if (cp_lexer_next_token_is (parser->lexer, CPP_OPEN_BRACE) + && !function_declarator_p (declarator)) + { + bool x; + initializer = cp_parser_initializer (parser, &x, &x); + } /* Otherwise, there is no initializer. */ else initializer = NULL_TREE; |