[docs] Add LICENSE.txt to the root of the mono-repo
[llvm-project.git] / clang / test / AST / ast-printer-lambda.cpp
blob08f1ff555b0b121ba352f9c10fdbc2fcee0bc140
1 // RUN: %clang_cc1 -ast-print -std=c++17 %s | FileCheck %s
3 struct S {
4 template<typename ... T>
5 void test1(int i, T... t) {
7 auto lambda = [i]{};
8 //CHECK: [i] {
11 auto lambda = [=]{};
12 //CHECK: [=] {
15 auto lambda = [&]{};
16 //CHECK: [&] {
19 auto lambda = [k{i}] {};
20 //CHECK: [k{i}] {
23 auto lambda = [k(i)] {};
24 //CHECK: [k(i)] {
27 auto lambda = [k = i] {};
28 //CHECK: [k = i] {
31 auto lambda = [t..., i]{};
32 //CHECK: [t..., i] {
35 auto lambda = [&t...]{};
36 //CHECK: [&t...] {
39 auto lambda = [this, &t...]{};
40 //CHECK: [this, &t...] {
43 auto lambda = [t..., this]{};
44 //CHECK: [t..., this] {
47 auto lambda = [k(t...)] {};
48 //CHECK: [k(t...)] {
51 auto lambda = [k{t...}] {};
52 //CHECK: [k{t...}] {