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
This commit is contained in:
Jason Merrill 2012-04-04 10:40:51 -04:00 committed by Jason Merrill
parent 0b9066cf56
commit 6f6e1e9e8b
4 changed files with 18 additions and 0 deletions

View File

@ -1,3 +1,8 @@
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>
PR c++/52796

View File

@ -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

View File

@ -1,3 +1,8 @@
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>
PR c++/52796

View File

@ -0,0 +1,7 @@
// PR c++/52845
// { dg-options "-std=c++11 -Wall" }
void f()
{
[](){};
}