diff options
author | Jason Merrill <jason@redhat.com> | 2010-04-27 17:21:35 -0400 |
---|---|---|
committer | Jason Merrill <jason@gcc.gnu.org> | 2010-04-27 17:21:35 -0400 |
commit | 95b24c84c3d66cba21214df45e041ed9a8bd6be1 (patch) | |
tree | 58660f2f4b59b74e52ea1598ba2b17a1cca8d99b /gcc/cp/semantics.c | |
parent | 60bfcbecc694c8a4d8e133fd31596955e69988e2 (diff) | |
download | gcc-95b24c84c3d66cba21214df45e041ed9a8bd6be1.zip gcc-95b24c84c3d66cba21214df45e041ed9a8bd6be1.tar.gz gcc-95b24c84c3d66cba21214df45e041ed9a8bd6be1.tar.bz2 |
re PR c++/43875 ([C++0x] ICE on invalid lambda return)
PR c++/43875
* semantics.c (lambda_return_type): Complain about
braced-init-list.
From-SVN: r158805
Diffstat (limited to 'gcc/cp/semantics.c')
-rw-r--r-- | gcc/cp/semantics.c | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/gcc/cp/semantics.c b/gcc/cp/semantics.c index ea01eb3..05c5168 100644 --- a/gcc/cp/semantics.c +++ b/gcc/cp/semantics.c @@ -5521,6 +5521,11 @@ tree lambda_return_type (tree expr) { tree type; + if (BRACE_ENCLOSED_INITIALIZER_P (expr)) + { + warning (0, "cannot deduce lambda return type from a braced-init-list"); + return void_type_node; + } if (type_dependent_expression_p (expr)) { type = cxx_make_type (DECLTYPE_TYPE); |