/cp
2011-02-18 Paolo Carlini <paolo.carlini@oracle.com>
PR c++/47795
* semantics.c (finish_non_static_data_member): Early return if
object is error_mark_node.
/testsuite
2011-02-18 Paolo Carlini <paolo.carlini@oracle.com>
PR c++/47795
* g++.dg/cpp0x/lambda/lambda-ice3.C: New.
From-SVN: r170275
+2011-02-18 Paolo Carlini <paolo.carlini@oracle.com>
+
+ PR c++/47795
+ * semantics.c (finish_non_static_data_member): Early return if
+ object is error_mark_node.
+
2011-02-18 Dodji Seketeli <dodji@redhat.com>
PR c++/47208
object = maybe_dummy_object (scope, NULL);
}
+ if (object == error_mark_node)
+ return error_mark_node;
+
/* DR 613: Can use non-static data members without an associated
object in sizeof/decltype/alignof. */
if (is_dummy_object (object) && cp_unevaluated_operand == 0
--- /dev/null
+// PR c++/47795
+// { dg-options "-std=c++0x" }
+
+class Klass
+{
+ unsigned int local;
+public:
+ bool dostuff();
+};
+
+bool Klass::dostuff()
+{
+ auto f = []() -> bool {
+ if (local & 1) { return true; } // { dg-error "not captured" }
+ return false;
+ };
+}
+
+int main()
+{
+ Klass c;
+ return 0;
+}