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-field-names.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
// "For each entity captured by copy, an unnamed non-static data member is
2
// declared in the closure type" -- test that there isn't a member of the
3
// closure with the same name as the captured variable.
4
 
5
// { dg-options -std=c++0x }
6
 
7
template 
8
struct A: public T
9
{
10
  A(T t): T(t) { }
11
  int f() { return this->i; }   // { dg-error "" "no member named i" }
12
};
13
 
14
int main()
15
{
16
  int i = 42;
17
  auto lam = [i]{ };
18
  lam.i = 24;                   // { dg-error "" "no member named i" }
19
  A a(lam);
20
  return a.f();
21
}

powered by: WebSVN 2.1.0

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