commit 12a282edca78579074f5f4180cd2dce1edebd2bf
Author: Jason Merrill <jason@redhat.com>
Date: Wed Apr 4 10:14:46 2012 -0400
PR c++/52845
* decl.c (finish_function): Update fntype after deducing return type.
@@ -13518,6 +13518,7 @@ finish_function (int flags)
"deduced to %<void%>");
}
apply_deduced_return_type (fndecl, void_type_node);
+ fntype = TREE_TYPE (fndecl);
}
/* Save constexpr function body before it gets munged by
new file mode 100644
@@ -0,0 +1,7 @@
+// PR c++/52845
+// { dg-options "-std=c++11 -Wall" }
+
+void f()
+{
+ [](){};
+}