+2015-04-23 Marek Polacek <polacek@redhat.com>
+
+ PR c++/65727
+ * semantics.c (maybe_resolve_dummy): Handle null return.
+
2015-04-23 Jason Merrill <jason@redhat.com>
PR c++/65721
/* In a lambda, need to go through 'this' capture. */
tree lam = CLASSTYPE_LAMBDA_EXPR (current_class_type);
tree cap = lambda_expr_this_capture (lam);
- object = build_x_indirect_ref (EXPR_LOCATION (object), cap,
- RO_NULL, tf_warning_or_error);
+ if (cap && cap != error_mark_node)
+ object = build_x_indirect_ref (EXPR_LOCATION (object), cap,
+ RO_NULL, tf_warning_or_error);
}
return object;
--- /dev/null
+// PR c++/65727
+// { dg-do compile { target c++11 } }
+
+struct type_a { void(*cb)(); };
+
+struct type_b
+{
+ type_b(type_a p);
+ void dummy();
+};
+
+template<class T>
+constexpr T function_c(T**t) {return **t;}
+
+class type_d {
+ public:
+ static void dummy();
+};
+class type_e {
+ public:
+ static type_b b;
+ type_d *d[1];
+};
+
+type_b type_e::b = {{[](){decltype(function_c(type_e::d))::dummy();}}};