PR c++/41920
* semantics.c (build_lambda_object): Call mark_used on captured
variables.
From-SVN: r156085
2010-01-20 Jason Merrill <jason@redhat.com>
+ PR c++/41920
+ * semantics.c (build_lambda_object): Call mark_used on captured
+ variables.
+
PR c++/40750
* decl.c (grokdeclarator): Clear type_quals for a member function
declared using a typedef. Don't complain about adding cv-quals
tree field = TREE_PURPOSE (node);
tree val = TREE_VALUE (node);
+ if (DECL_P (val))
+ mark_used (val);
+
/* Mere mortals can't copy arrays with aggregate initialization, so
do some magic to make it work here. */
if (TREE_CODE (TREE_TYPE (field)) == ARRAY_TYPE)
2010-01-20 Jason Merrill <jason@redhat.com>
+ PR c++/41920
+ * g++.dg/cpp0x/lambda/lambda-warn1.C: New.
+
PR c++/40750
* g++.dg/parse/fn-typedef1.C: New.
* g++.dg/other/cv_quals.C: Adjust.
--- /dev/null
+// PR c++/41920
+// { dg-options "-std=c++0x -Wall -Wextra" }
+
+int foo(int i)
+{
+ auto bar = [=](){ return i; };
+ return bar();
+}