OpenCores
URL https://opencores.org/ocsvn/openrisc_me/openrisc_me/trunk

Subversion Repositories openrisc_me

[/] [openrisc/] [trunk/] [gnu-src/] [gcc-4.5.1/] [gcc/] [testsuite/] [g++.dg/] [cpp0x/] [lambda/] [lambda-nested2.C] - Blame information for rev 307

Go to most recent revision | Details | Compare with Previous | View Log

Line No. Rev Author Line
1 301 jeremybenn
// Testcase from N2998
2
// { dg-options -std=c++0x }
3
 
4
void f1(int i) {
5
  int const N = 20;
6
  auto m1 = [=]{
7
     int const M = 30;
8
     auto m2 = [i]{
9
        int x[N][M]; // OK: N and M are not "used"
10
        x[0][0] = i; // OK: i is explicitly captured by m2
11
                     // and implicitly captured by m1
12
     };
13
  };
14
  struct s1 {
15
    int f;
16
    int work(int n) {
17
      int m = n*n;
18
      int j = 40;
19
      auto m3 = [this,m]{
20
        /*auto m4=*/[&,j]{      // { dg-error "j. is not captured" }
21
          int x = n;            // { dg-error "n. is not captured" }
22
          x += m;               // OK: m implicitly captured by m4
23
                                // and explicitly captured by m3
24
          x += i;               // { dg-error "i. is not captured" }
25
          x += f;               // OK: this captured implicitly by m4
26
                                // and explicitly by m3
27
        };
28
      };
29
    }
30
  };
31
}

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.