* semantics.c (finish_id_expression): Mark captured variables used.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/branches/gcc-4_6-branch@178278
138bc75d-0d04-0410-961f-
82ee72b054a4
+2011-08-29 Jason Merrill <jason@redhat.com>
+
+ PR c++/50224
+ * semantics.c (finish_id_expression): Mark captured variables used.
+
2011-08-25 Jason Merrill <jason@redhat.com>
PR c++/50157
tree lambda_expr = NULL_TREE;
tree initializer = convert_from_reference (decl);
+ /* Mark it as used now even if the use is ill-formed. */
+ mark_used (decl);
+
/* Core issue 696: "[At the July 2009 meeting] the CWG expressed
support for an approach in which a reference to a local
[constant] automatic variable in a nested class or lambda body
+2011-08-29 Jason Merrill <jason@redhat.com>
+
+ PR c++/50224
+ * g++.dg/cpp0x/lambda/lambda-use2.C: New.
+
2011-08-29 Thomas Koenig <tkoenig@gcc.gnu.org>
Backport from trunk
--- /dev/null
+// PR c++/50224
+// { dg-options "-std=c++0x -Wunused-parameter" }
+
+struct T;
+
+void m(T& t) // ERROR here
+{
+ [&]{
+ t; // ``t`` is referenced here
+ };
+}