===================================================================
@@ -0,0 +1,16 @@
+// PR c++/42083
+// { dg-options "-std=c++0x" }
+
+template<typename F>
+decltype(F()) run(F f) // { dg-message "note" }
+{
+ return f();
+}
+
+int main()
+{
+ auto l = []() { return 5; };
+
+ run(l); // { dg-error "no match" }
+ // { dg-message "candidate" "candidate note" { target *-*-* } 14 }
+}
===================================================================
@@ -314,9 +314,11 @@ build_value_init (tree type, tsubst_flags_t compla
tree ctor = build_special_member_call
(NULL_TREE, complete_ctor_identifier,
NULL, type, LOOKUP_NORMAL, complain);
-
- ctor = build_aggr_init_expr (type, ctor);
- AGGR_INIT_ZERO_FIRST (ctor) = 1;
+ if (ctor != error_mark_node)
+ {
+ ctor = build_aggr_init_expr (type, ctor);
+ AGGR_INIT_ZERO_FIRST (ctor) = 1;
+ }
return ctor;
}
}