gcc/testsuite/g++.dg/cpp1y/lambda-init20.C
raw| 1 | // PR c++/79378 |
| 2 | // { dg-do compile { target c++14 } } |
| 3 | |
| 4 | int main() { |
| 5 | int x = 0; |
| 6 | [x=x, &r=x] { |
| 7 | using ty1 = int; |
| 8 | using ty1 = decltype(x); |
| 9 | |
| 10 | using ty2 = int&; |
| 11 | using ty2 = decltype(r); |
| 12 | }; |
| 13 | |
| 14 | const int cx = 0; |
| 15 | [x=cx, &r=cx] { |
| 16 | using ty1 = int; |
| 17 | using ty1 = decltype(x); |
| 18 | |
| 19 | using ty2 = const int&; |
| 20 | using ty2 = decltype(r); |
| 21 | }; |
| 22 | } |