summaryrefslogtreecommitdiff
path: root/gcc/cp/parser.c
diff options
context:
space:
mode:
authorJason Merrill <jason@redhat.com>2010-11-08 22:54:24 -0500
committerJason Merrill <jason@gcc.gnu.org>2010-11-08 22:54:24 -0500
commit9b7d05093738e51274c3b473ede23799db93bf98 (patch)
tree98fb4d94e9d9d03d85c305dab606ebd564af92c9 /gcc/cp/parser.c
parentedb7c512888ad65f3804585a43448ada0d10f690 (diff)
downloadgcc-9b7d05093738e51274c3b473ede23799db93bf98.tar.gz
re PR c++/46382 (constexpr vs. static_assert in constexpr ctors)
PR c++/46382 * semantics.c (check_constexpr_ctor_body): New fn. * parser.c (cp_parser_ctor_initializer_opt_and_function_body): Call it. * cp-tree.h: Declare it. From-SVN: r166471
Diffstat (limited to 'gcc/cp/parser.c')
-rw-r--r--gcc/cp/parser.c10
1 files changed, 2 insertions, 8 deletions
diff --git a/gcc/cp/parser.c b/gcc/cp/parser.c
index 6a9e4d7b981..489794161f5 100644
--- a/gcc/cp/parser.c
+++ b/gcc/cp/parser.c
@@ -16347,14 +16347,8 @@ cp_parser_ctor_initializer_opt_and_function_body (cp_parser *parser)
}
/* Parse the function-body. */
cp_parser_function_body (parser);
- if (check_body_p
- && (TREE_CODE (list) != STATEMENT_LIST
- || (last == NULL && STATEMENT_LIST_TAIL (list) != NULL)
- || (last != NULL && last != STATEMENT_LIST_TAIL (list)->stmt)))
- {
- error ("constexpr constructor does not have empty body");
- DECL_DECLARED_CONSTEXPR_P (current_function_decl) = false;
- }
+ if (check_body_p)
+ check_constexpr_ctor_body (last, list);
/* Finish the function body. */
finish_function_body (body);