summaryrefslogtreecommitdiff
path: root/gcc/testsuite/g++.dg/cpp0x/lambda/lambda-ice3.C
diff options
context:
space:
mode:
Diffstat (limited to 'gcc/testsuite/g++.dg/cpp0x/lambda/lambda-ice3.C')
-rw-r--r--gcc/testsuite/g++.dg/cpp0x/lambda/lambda-ice3.C23
1 files changed, 23 insertions, 0 deletions
diff --git a/gcc/testsuite/g++.dg/cpp0x/lambda/lambda-ice3.C b/gcc/testsuite/g++.dg/cpp0x/lambda/lambda-ice3.C
new file mode 100644
index 000000000..8ff36478d
--- /dev/null
+++ b/gcc/testsuite/g++.dg/cpp0x/lambda/lambda-ice3.C
@@ -0,0 +1,23 @@
+// 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;
+}