PR c++/49598
* semantics.c (finish_id_expression): convert_from_reference.
From-SVN: r175857
+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
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
+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
--- /dev/null
+// 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;
+}