repo.or.cz
/
official-gcc.git
/
blob
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
log
|
graphiclog1
|
graphiclog2
|
commit
|
commitdiff
|
tree
|
refs
|
edit
|
fork
blame
|
history
|
raw
|
HEAD
Rebase.
[official-gcc.git]
/
gcc
/
testsuite
/
g++.dg
/
cpp0x
/
lambda
/
lambda-initlist2.C
blob
3c25f0eb97df7da488bcbc07b47648a5baa46369
1
// PR c++/54947
2
// { dg-do compile { target c++11 } }
3
4
struct X
5
{
6
template<typename L>
7
X(L)
8
{ }
9
};
10
11
template<typename A>
12
void
13
test()
14
{
15
int i = 0;
16
17
A a_ok_1( [=] { return i; } ); // OK
18
A a_ok_2( [i] { return i; } ); // OK
19
20
A a_err_1{ [i] { return i; } }; // error
21
A a_err_2{ [=] { return i; } }; // error
22
}
23
24
int main()
25
{
26
test<X>();
27
}