aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJason Merrill <jason@redhat.com>2012-04-04 10:40:51 -0400
committerJason Merrill <jason@gcc.gnu.org>2012-04-04 10:40:51 -0400
commit6f6e1e9e8b306bdc76fbd7268583c180b1e32046 (patch)
tree3fe3fddac64b54e7e2217dfc23d785abd4262fad
parent0b9066cf56f688034561c58adb5cadaf102abb26 (diff)
downloadgcc-6f6e1e9e8b306bdc76fbd7268583c180b1e32046.zip
gcc-6f6e1e9e8b306bdc76fbd7268583c180b1e32046.tar.gz
gcc-6f6e1e9e8b306bdc76fbd7268583c180b1e32046.tar.bz2
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
-rw-r--r--gcc/cp/ChangeLog5
-rw-r--r--gcc/cp/decl.c1
-rw-r--r--gcc/testsuite/ChangeLog5
-rw-r--r--gcc/testsuite/g++.dg/cpp0x/lambda/lambda-warn4.C7
4 files changed, 18 insertions, 0 deletions
diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog
index 4b42e41..1b93ecd 100644
--- a/gcc/cp/ChangeLog
+++ b/gcc/cp/ChangeLog
@@ -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
diff --git a/gcc/cp/decl.c b/gcc/cp/decl.c
index d210f19..e2f01d5 100644
--- a/gcc/cp/decl.c
+++ b/gcc/cp/decl.c
@@ -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
diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog
index ed9a3c5..92c18df 100644
--- a/gcc/testsuite/ChangeLog
+++ b/gcc/testsuite/ChangeLog
@@ -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
diff --git a/gcc/testsuite/g++.dg/cpp0x/lambda/lambda-warn4.C b/gcc/testsuite/g++.dg/cpp0x/lambda/lambda-warn4.C
new file mode 100644
index 0000000..2afeccf
--- /dev/null
+++ b/gcc/testsuite/g++.dg/cpp0x/lambda/lambda-warn4.C
@@ -0,0 +1,7 @@
+// PR c++/52845
+// { dg-options "-std=c++11 -Wall" }
+
+void f()
+{
+ [](){};
+}