+2019-02-27 Paolo Carlini <paolo.carlini@oracle.com>
+
+ PR c++/89488
+ * method.c (process_subob_fn): When maybe_instantiate_noexcept
+ returns false don't call merge_exception_specifiers.
+
+2019-02-27 Paolo Carlini <paolo.carlini@oracle.com>
+
+ PR c++/88987
+ * parser.c (cp_parser_noexcept_specification_opt): Return NULL_TREE
+ for a non-constant parsed expression.
+
2019-02-26 Jakub Jelinek <jakub@redhat.com>
PR c++/89481
if (spec_p)
{
- maybe_instantiate_noexcept (fn);
- tree raises = TYPE_RAISES_EXCEPTIONS (TREE_TYPE (fn));
- *spec_p = merge_exception_specifiers (*spec_p, raises);
+ if (!maybe_instantiate_noexcept (fn))
+ *spec_p = error_mark_node;
+ else
+ {
+ tree raises = TYPE_RAISES_EXCEPTIONS (TREE_TYPE (fn));
+ *spec_p = merge_exception_specifiers (*spec_p, raises);
+ }
}
if (!trivial_fn_p (fn) && !dtor_from_ctor)
parser->type_definition_forbidden_message
= G_("types may not be defined in an exception-specification");
- expr = cp_parser_constant_expression (parser);
+ bool non_constant_p;
+ expr
+ = cp_parser_constant_expression (parser,
+ /*allow_non_constant=*/true,
+ &non_constant_p);
+ if (non_constant_p
+ && !require_potential_rvalue_constant_expression (expr))
+ {
+ expr = NULL_TREE;
+ return_cond = true;
+ }
/* Restore the saved message. */
parser->type_definition_forbidden_message = saved_message;
+2019-02-27 Paolo Carlini <paolo.carlini@oracle.com>
+
+ PR c++/89488
+ * g++.dg/cpp0x/nsdmi15.C: New.
+
+2019-02-27 Paolo Carlini <paolo.carlini@oracle.com>
+
+ PR c++/88987
+ * g++.dg/cpp0x/pr88987.C: New.
+
2019-02-27 Jakub Jelinek <jakub@redhat.com>
PR tree-optimization/89280
--- /dev/null
+// PR c++/89488
+// { dg-do compile { target c++11 } }
+
+struct zl {
+ struct {
+ int x2 = zl (); // { dg-error "default member" }
+ } fx;
+};
--- /dev/null
+// { dg-do compile { target c++11 } }
+
+int sm;
+
+template <typename T> T
+pk () noexcept (sm) // { dg-error "constant expression" }
+{
+ return 0;
+}