mirror of git://gcc.gnu.org/git/gcc.git
re PR c++/52599 (ICE on illegal constexpr constructor declaration)
/cp 2012-04-17 Paolo Carlini <paolo.carlini@oracle.com> PR c++/52599 * semantics.c (build_constexpr_constructor_member_initializers): Check for function-try-block as function-body. /testsuite 2012-04-17 Paolo Carlini <paolo.carlini@oracle.com> PR c++/52599 * g++.dg/cpp0x/constexpr-ctor10.C: New. /cp 2012-04-17 Paolo Carlini <paolo.carlini@oracle.com> PR c++/53003 * parser.c (cp_parser_member_declaration): Check that initializer_token_start is non null before dereferencing it. /testsuite 2012-04-17 Paolo Carlini <paolo.carlini@oracle.com> PR c++/53003 * g++.dg/parse/crash59.C: New. From-SVN: r186541
This commit is contained in:
parent
9fc37b2b7b
commit
0fced8150b
|
@ -1,3 +1,15 @@
|
|||
2012-04-17 Paolo Carlini <paolo.carlini@oracle.com>
|
||||
|
||||
PR c++/52599
|
||||
* semantics.c (build_constexpr_constructor_member_initializers):
|
||||
Check for function-try-block as function-body.
|
||||
|
||||
2012-04-17 Paolo Carlini <paolo.carlini@oracle.com>
|
||||
|
||||
PR c++/53003
|
||||
* parser.c (cp_parser_member_declaration): Check that
|
||||
initializer_token_start is non null before dereferencing it.
|
||||
|
||||
2012-04-16 Jason Merrill <jason@redhat.com>
|
||||
|
||||
PR c++/38543
|
||||
|
|
|
@ -19109,7 +19109,7 @@ cp_parser_member_declaration (cp_parser* parser)
|
|||
possible that this fact is an oversight in the
|
||||
standard, since a pure function may be defined
|
||||
outside of the class-specifier. */
|
||||
if (initializer)
|
||||
if (initializer && initializer_token_start)
|
||||
error_at (initializer_token_start->location,
|
||||
"pure-specifier on function-definition");
|
||||
decl = cp_parser_save_member_function_body (parser,
|
||||
|
|
|
@ -5921,6 +5921,12 @@ build_constexpr_constructor_member_initializers (tree type, tree body)
|
|||
break;
|
||||
}
|
||||
}
|
||||
else if (TREE_CODE (body) == TRY_BLOCK)
|
||||
{
|
||||
error ("body of %<constexpr%> constructor cannot be "
|
||||
"a function-try-block");
|
||||
return error_mark_node;
|
||||
}
|
||||
else if (EXPR_P (body))
|
||||
ok = build_data_member_initialization (body, &vec);
|
||||
else
|
||||
|
|
|
@ -1,3 +1,13 @@
|
|||
2012-04-17 Paolo Carlini <paolo.carlini@oracle.com>
|
||||
|
||||
PR c++/52599
|
||||
* g++.dg/cpp0x/constexpr-ctor10.C: New.
|
||||
|
||||
2012-04-17 Paolo Carlini <paolo.carlini@oracle.com>
|
||||
|
||||
PR c++/53003
|
||||
* g++.dg/parse/crash59.C: New.
|
||||
|
||||
2012-04-17 Michael Matz <matz@suse.de>
|
||||
|
||||
PR tree-optimization/18437
|
||||
|
|
|
@ -0,0 +1,6 @@
|
|||
// PR c++/52599
|
||||
// { dg-options -std=c++11 }
|
||||
|
||||
struct foo {
|
||||
constexpr foo() try { } catch(...) { }; // { dg-error "constructor" }
|
||||
};
|
|
@ -0,0 +1,3 @@
|
|||
// PR c++/53003
|
||||
|
||||
struct A{ void a{} return b // { dg-error "function definition|expected" }
|
Loading…
Reference in New Issue