Commit 6f6e1e9e by Jason Merrill Committed by Jason Merrill

re PR c++/52845 (non-void return type deduced for lambda with empty compound statement)

	PR c++/52845
	* decl.c (finish_function): Update fntype after deducing return type.

From-SVN: r186139
parent 0b9066cf
2012-04-04 Jason Merrill <jason@redhat.com>
PR c++/52845
* decl.c (finish_function): Update fntype after deducing return type.
2012-04-03 Jason Merrill <jason@redhat.com> 2012-04-03 Jason Merrill <jason@redhat.com>
PR c++/52796 PR c++/52796
......
...@@ -13518,6 +13518,7 @@ finish_function (int flags) ...@@ -13518,6 +13518,7 @@ finish_function (int flags)
"deduced to %<void%>"); "deduced to %<void%>");
} }
apply_deduced_return_type (fndecl, void_type_node); apply_deduced_return_type (fndecl, void_type_node);
fntype = TREE_TYPE (fndecl);
} }
/* Save constexpr function body before it gets munged by /* Save constexpr function body before it gets munged by
......
2012-04-04 Jason Merrill <jason@redhat.com>
PR c++/52845
* g++.dg/cpp0x/lambda/lambda-warn4.C: New.
2012-04-03 Jason Merrill <jason@redhat.com> 2012-04-03 Jason Merrill <jason@redhat.com>
PR c++/52796 PR c++/52796
......
// PR c++/52845
// { dg-options "-std=c++11 -Wall" }
void f()
{
[](){};
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment