semantics.c (check_constexpr_ctor_body_1): New.
authorPaolo Carlini <paolo.carlini@oracle.com>
Thu, 9 Oct 2014 19:22:53 +0000 (19:22 +0000)
committerPaolo Carlini <paolo@gcc.gnu.org>
Thu, 9 Oct 2014 19:22:53 +0000 (19:22 +0000)
commit3369b9193606b86677e65bc96699939fb6a8d13e
tree4553766deb632f48b011e507c8e87b13c5f4fcbf
parent5f60643158669361212ef79bfec16e8c73f4c138
semantics.c (check_constexpr_ctor_body_1): New.

/cp
2014-10-09  Paolo Carlini  <paolo.carlini@oracle.com>

* semantics.c (check_constexpr_ctor_body_1): New.
(check_constexpr_ctor_body): Use it; add bool parameter.
(build_data_member_initialization): Handle BIND_EXPR and
USING_STMT in the main conditional.
(build_constexpr_constructor_member_initializers): Do not
handle BIND_EXPR here.
(constexpr_fn_retval): Handle BIND_EXPR in the switch.
(massage_constexpr_body): Don't do it here.
* parser.c (cp_parser_ctor_initializer_opt_and_function_body):
Adjust check_constexpr_ctor_body call.
(cp_parser_compound_statement): Do not pedwarn for compound-statement
in constexpr function in C++14 mode.
* cp-tree.h (check_constexpr_ctor_body): Update declaration.

/testsuite
2014-10-09  Paolo Carlini  <paolo.carlini@oracle.com>

* g++.dg/cpp0x/constexpr-using3.C: New.
* g++.dg/cpp1y/constexpr-local-compound1.C: Likewise.
* g++.dg/cpp1y/constexpr-type-def-compound1.C: Likewise.
* g++.dg/cpp1y/constexpr-local1.C: Extend.
* g++.dg/cpp0x/constexpr-compound.C: Specify expected error.

From-SVN: r216049
gcc/cp/ChangeLog
gcc/cp/cp-tree.h
gcc/cp/parser.c
gcc/cp/semantics.c
gcc/testsuite/ChangeLog
gcc/testsuite/g++.dg/cpp0x/constexpr-compound.C
gcc/testsuite/g++.dg/cpp0x/constexpr-using3.C [new file with mode: 0644]
gcc/testsuite/g++.dg/cpp1y/constexpr-local-compound1.C [new file with mode: 0644]
gcc/testsuite/g++.dg/cpp1y/constexpr-local1.C
gcc/testsuite/g++.dg/cpp1y/constexpr-type-def-compound1.C [new file with mode: 0644]