+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
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,
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
+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
--- /dev/null
+// PR c++/52599
+// { dg-options -std=c++11 }
+
+struct foo {
+ constexpr foo() try { } catch(...) { }; // { dg-error "constructor" }
+};
--- /dev/null
+// PR c++/53003
+
+struct A{ void a{} return b // { dg-error "function definition|expected" }