PR c++/56915
* semantics.c (maybe_add_lambda_conv_op): Give up if the call op
isn't defined.
From-SVN: r199231
+2013-05-22 Jason Merrill <jason@redhat.com>
+
+ PR c++/56915
+ * semantics.c (maybe_add_lambda_conv_op): Give up if the call op
+ isn't defined.
+
2013-05-22 Paolo Carlini <paolo.carlini@oracle.com>
PR c++/57352
if (processing_template_decl)
return;
+ if (DECL_INITIAL (callop) == NULL_TREE)
+ {
+ /* If the op() wasn't instantiated due to errors, give up. */
+ gcc_assert (errorcount || sorrycount);
+ return;
+ }
+
stattype = build_function_type (TREE_TYPE (TREE_TYPE (callop)),
FUNCTION_ARG_CHAIN (callop));
--- /dev/null
+// PR c++/56915
+// { dg-require-effective-target c++11 }
+
+template <typename T>
+class A
+{
+ typename T::type b(); // { dg-error "int" }
+};
+
+template <typename T, typename U>
+void waldo(T, U) {}
+
+template <typename T>
+void bar()
+{
+ waldo([](A<T> a){ return a; },
+ []{});
+}
+
+int main()
+{
+ bar<int>();
+}
+
+// { dg-prune-output "used but never defined" }