diff options
author | Jason Merrill <jason@redhat.com> | 2011-07-05 10:47:21 -0400 |
---|---|---|
committer | Jason Merrill <jason@gcc.gnu.org> | 2011-07-05 10:47:21 -0400 |
commit | f395f5e2a1c7d512fc268d447f58b3ec83ae9506 (patch) | |
tree | 3fb3f2b5136ab7c8b55fd70ff2f76eb02ecce044 | |
parent | fce5dddd3da4c6b9818b60a358b1e4869f922114 (diff) | |
download | gcc-f395f5e2a1c7d512fc268d447f58b3ec83ae9506.zip gcc-f395f5e2a1c7d512fc268d447f58b3ec83ae9506.tar.gz gcc-f395f5e2a1c7d512fc268d447f58b3ec83ae9506.tar.bz2 |
re PR c++/49598 ([C++0x] Ice on lambda with implicit capture by value.)
PR c++/49598
* semantics.c (finish_id_expression): convert_from_reference.
From-SVN: r175857
-rw-r--r-- | gcc/cp/ChangeLog | 5 | ||||
-rw-r--r-- | gcc/cp/semantics.c | 2 | ||||
-rw-r--r-- | gcc/testsuite/ChangeLog | 4 | ||||
-rw-r--r-- | gcc/testsuite/g++.dg/cpp0x/lambda/lambda-ref2.C | 13 |
4 files changed, 23 insertions, 1 deletions
diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog index d3aa1a9..a1104b4 100644 --- a/gcc/cp/ChangeLog +++ b/gcc/cp/ChangeLog @@ -1,3 +1,8 @@ +2011-07-05 Jason Merrill <jason@redhat.com> + + PR c++/49598 + * semantics.c (finish_id_expression): convert_from_reference. + 2011-07-05 Richard Guenther <rguenther@suse.de> * decl.c (cxx_init_decl_processing): Defer building common diff --git a/gcc/cp/semantics.c b/gcc/cp/semantics.c index 619c058..fa22bc9 100644 --- a/gcc/cp/semantics.c +++ b/gcc/cp/semantics.c @@ -2942,7 +2942,7 @@ finish_id_expression (tree id_expression, tree containing_function = current_function_decl; tree lambda_stack = NULL_TREE; tree lambda_expr = NULL_TREE; - tree initializer = decl; + tree initializer = convert_from_reference (decl); /* Core issue 696: "[At the July 2009 meeting] the CWG expressed support for an approach in which a reference to a local diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index 87833d3..8917635 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,7 @@ +2011-07-05 Jason Merrill <jason@redhat.com> + + * g++.dg/cpp0x/lambda/lambda-ref2.C: New. + 2011-07-05 Razya Ladelsky <razya@il.ibm.com> PR tree-optimization/49580 diff --git a/gcc/testsuite/g++.dg/cpp0x/lambda/lambda-ref2.C b/gcc/testsuite/g++.dg/cpp0x/lambda/lambda-ref2.C new file mode 100644 index 0000000..15f1d90 --- /dev/null +++ b/gcc/testsuite/g++.dg/cpp0x/lambda/lambda-ref2.C @@ -0,0 +1,13 @@ +// PR c++/49598 +// { dg-options -std=c++0x } +// { dg-do run } + +int +main() +{ + int i = 10; + int& ir = i; + + if ([=]{ return ir; }() != 10) + return 1; +} |