Home
last modified time | relevance | path

Searched refs:lambda (Results 1 – 25 of 194) sorted by relevance

12345678

/llvm-project/clang/test/AST/
H A Dast-printer-lambda.cpp7 auto lambda = [i]{}; in test1() local
11 auto lambda = [=]{}; in test1() local
15 auto lambda = [&]{}; in test1() local
19 auto lambda = [k{i}] {}; in test1() local
23 auto lambda = [k(i)] {}; in test1() local
27 auto lambda = [k = i] {}; in test1() local
31 auto lambda = [t..., i]{}; in test1() local
35 auto lambda = [&t...]{}; in test1() local
39 auto lambda = [this, &t...]{}; in test1() local
43 auto lambda = [t..., this]{}; in test1() local
[all …]
/llvm-project/clang/test/SemaCXX/
H A Dlambda-expressions-gh56071.cpp7 template <typename lambda> struct lambda_wrapper {
8 lambda &outer_lambda;
9 lambda_wrapper(lambda& outer_lambda) : outer_lambda(outer_lambda) {} in lambda_wrapper()
13 template <int... nums, typename lambda>
14 void bw(lambda& outer_lambda) { in bw()
18 template <typename lambda> auto check_return_type(lambda inner_lambda) { in check_return_type()
34 template <typename lambda>
35 auto run_lambda_with_zero(lambda l) { in run_lambda_with_zero()
38 template <typename ... Ts, typename lambda>
39 void run_lambda_once_per_type(lambda l) { in run_lambda_once_per_type()
H A Dattr-musttail.cpp161 auto lambda = []() { return 12; }; // expected-note {{'operator()' declared here}} in TestNonCapturingLambda() local
163 return lambda(); // expected-error {{non-member function cannot perform a tail call to non-static member function 'operator()'}} in TestNonCapturingLambda()
166 auto lambda_fptr = static_cast<int (*)()>(lambda); in TestNonCapturingLambda()
168 [[clang::musttail]] return (+lambda)(); in TestNonCapturingLambda()
173 auto lambda = [x]() { return 12; }; // expected-note {{'operator()' declared here}} in TestCapturingLambda() local
175 return lambda(); // expected-error {{non-member function cannot perform a tail call to non-static member function 'operator()'}} in TestCapturingLambda()
/llvm-project/clang/test/Analysis/
H A Dlambdas-generalized-capture.cpp7 auto lambda = [x=v]() { in generalizedCapture() local
11 int result = lambda(); in generalizedCapture()
17 auto lambda = [x=v++]() { in sideEffectsInGeneralizedCapture() local
22 int r1 = lambda(); in sideEffectsInGeneralizedCapture()
23 int r2 = lambda(); in sideEffectsInGeneralizedCapture()
35 auto lambda = [x=addOne(v)]() { in inliningInGeneralizedCapture() local
39 int result = lambda(); in inliningInGeneralizedCapture()
44 auto lambda = [x=(p ? 1 : 2)]() { in caseSplitInGeneralizedCapture() local
48 int result = lambda(); in caseSplitInGeneralizedCapture()
H A Dlambdas.mm92 auto lambda = [y]{ return y; };
93 int(^block)() = lambda;
102 auto lambda = [x]() mutable {
107 // The block should copy the lambda before capturing.
108 int(^block)() = lambda;
116 // Because block copied the lambda, r3 should be 1.
117 int r3 = lambda();
120 // Aliasing the block shouldn't copy the lambda.
129 // Another copy of lambda
130 int(^blockSecondCopy)() = lambda;
[all …]
H A Dnonnullparamchecker-crash.cpp6 auto lambda = [&] { f(i); }; in f() local
7 typedef decltype(lambda) T; in f()
8 T* blah = new T(lambda); in f()
/llvm-project/clang/test/CodeGenCXX/
H A Dlambda-conversion-op-cc.cpp10 auto lambda = [](int i, float f, double d) CC { return i + f + d; }; in usage() local
12 double (*CC fp)(int, float, double) = lambda; in usage()
14 double (*__attribute__((thiscall)) fp2)(int, float, double) = lambda; in usage()
15 double (*__attribute__((stdcall)) fp3)(int, float, double) = lambda; in usage()
16 double (*__attribute__((fastcall)) fp4)(int, float, double) = lambda; in usage()
17 double (*__attribute__((vectorcall)) fp5)(int, float, double) = lambda; in usage()
27 auto x = +lambda; in usage()
H A Dexceptions-seh-filter-captures.cpp91 auto lambda = [&]() { in test_lambda() local
98 lambda(); in test_lambda()
123 auto lambda = [=]() { in this_in_lambda() local
129 lambda(); in this_in_lambda()
/llvm-project/clang-tools-extra/docs/clang-tidy/checks/cppcoreguidelines/
H A Davoid-capturing-lambda-coroutines.rst1 .. title:: clang-tidy - cppcoreguidelines-avoid-capturing-lambda-coroutines
3 cppcoreguidelines-avoid-capturing-lambda-coroutines
7 use-after-free errors and suggests avoiding captures or ensuring the lambda
17 When a lambda expression creates a coroutine, it results in a closure object
31 const auto lambda = [value, sharedFoo]() -> std::future<void>
37 lambda();
38 } // the lambda closure object has now gone out of scope
40 In this example, the lambda object is defined with two captures: value and
41 ``sharedFoo``. When ``lambda()`` is called, the lambda object is created on the
43 is suspended, the lambda object goes out of scope, and the closure object is
[all …]
/llvm-project/clang/test/PCH/
H A Dcxx11-lambdas.mm14 auto lambda = [&](int z) { return x + z; };
15 return i + lambda(y);
20 auto lambda = [=](int N) -> int {
27 return lambda(n);
31 auto lambda = [=](int m) { return n + m; };
32 int (^block)(int) = lambda;
57 // CHECK-PRINT: lambda = [&](int z)
H A Dcxx1y-lambdas.mm14 auto lambda = [](auto z) { return z + z; };
15 return i + lambda(y);
19 auto lambda = [](auto N) -> int {
28 return lambda(n);
32 auto lambda = [=](int m) { return n + m; };
33 int (^block)(int) = lambda;
55 // CHECK-PRINT: lambda = [](auto z
/llvm-project/clang/test/Parser/
H A Dobjcxx0x-lambda-expressions.mm9 // fail to parse as a lambda introducer, so we get objc message parsing errors instead
12 []; // expected-error {{expected body of lambda expression}}
13 [=,foo+] {}; // expected-error {{expected ',' or ']' in lambda capture list}}
35 [get(bar), baz]; // expected-error {{expected body of lambda}}
38 [foo = bar + baz]; // expected-error {{expected body of lambda}}
39 … { bar, baz }]; // expected-error {{<initializer_list>}} expected-error {{expected body of lambda}}
41 …{ bar }, baz ]; // expected-error {{<initializer_list>}} expected-error {{expected body of lambda}}
/llvm-project/clang/test/SemaOpenCLCXX/
H A Daddress-space-lambda.clcpp13 // Test lambda with default parameters
17 …xpected-error-re{{no matching function for call to object of type '__constant (lambda at {{.*}})'}}
19 // we can test when taking lambda type from the object.
49 …const1(); //expected-error{{no matching function for call to object of type '__constant (lambda at…
56 …const2(); //expected-error{{no matching function for call to object of type '__constant (lambda at…
61 …[&] () __global {} (); //expected-error{{no matching function for call to object of type '(lambda
62 … (); //expected-error{{no matching function for call to object of type '(lambda at}} expected-note…
64 …[&] __private {} (); // expected-error{{no matching function for call to object of type '(lambda a…
66 // expected-warning@-2{{lambda without a parameter clause is a C++23 extension}}
70 [&] () __private mutable {} (); //expected-error{{expected body of lambda expression}}
/llvm-project/lldb/test/API/api/multiple-targets/
H A Dmain.cpp16 auto lambda = [&](){ in main() local
23 std::thread thread1(lambda); in main()
24 std::thread thread2(lambda); in main()
25 std::thread thread3(lambda); in main()
/llvm-project/clang/test/CXX/expr/expr.prim/expr.prim.lambda/
H A Dblocks.mm5 (void)[var] { }; // expected-error{{__block variable 'var' cannot be captured in a lambda}}
7 (void)[=] { var = 17; }; // expected-error{{__block variable 'var' cannot be captured in a lambda}}
13 const auto lambda = [=](int x) { return x + captured; };
14 int (^b2)(int) = lambda;
68 if ([](){}) { // expected-warning{{address of lambda function pointer conversion operator will always evaluate to 'true'}}
71 bool b = []{}; // expected-warning{{address of lambda function pointer conversion operator will always evaluate to 'true'}}
111 bool r1 = c; // expected-warning{{address of lambda function pointer conversion operator will always evaluate to 'true'}}
113 expected-warning{{address of lambda function pointer conversion operator will always evaluate to 'true'}}
H A Dp3.cpp6 auto lambda = [i]() -> void {}; // expected-note 2{{candidate constructor}} in test_nonaggregate() local
7 decltype(lambda) foo = { 1 }; // expected-error{{no matching constructor}} in test_nonaggregate()
8 static_assert(__is_literal(decltype(lambda)) == (__cplusplus >= 201703L), ""); in test_nonaggregate()
H A Dtemplates.cpp20 auto lambda = [=, &y] () -> T { in captures() local
25 return lambda(); in captures()
40 auto lambda = [=](bool b) { return x + y; }; in infer_result() local
41 …return lambda(true); // expected-error{{no viable conversion from returned value of type 'X' to fu… in infer_result()
/llvm-project/lldb/test/API/commands/expression/expr_inside_lambda/
H A Dmain.cpp43 auto lambda = [&shadowed, this, &local_var, in method() local
66 auto lambda = [this] { in method() local
72 lambda(); in method()
80 lambda(); in method()
/llvm-project/clang-tools-extra/test/clang-tidy/checkers/bugprone/
H A Dinfinite-loop.cpp464 auto lambda = [=]() { in lambda_capture_with_loop_inside_lambda_bad() local
471 lambda(); in lambda_capture_with_loop_inside_lambda_bad()
476 auto lambda = [captured_finished=finished]() { in lambda_capture_with_loop_inside_lambda_bad_init_capture() local
483 lambda(); in lambda_capture_with_loop_inside_lambda_bad_init_capture()
488 auto lambda = [&]() { in lambda_capture_with_loop_inside_lambda_good() local
495 lambda(); in lambda_capture_with_loop_inside_lambda_good()
500 auto lambda = [&captured_finished=finished]() { in lambda_capture_with_loop_inside_lambda_good_init_capture() local
507 lambda(); in lambda_capture_with_loop_inside_lambda_good_init_capture()
/llvm-project/clang-tools-extra/docs/clang-tidy/checks/bugprone/
H A Dlambda-function-name.rst1 .. title:: clang-tidy - bugprone-lambda-function-name
3 bugprone-lambda-function-name
6 Checks for attempts to get the name of a function from within a lambda
7 expression. The name of a lambda is always something like ``operator()``, which
/llvm-project/polly/lib/External/isl/imath/tests/
H A Dimath-test.scm43 (lambda (n-digits d-digits num)
51 (lambda (n-digits d-digits num)
61 (lambda (n-digits d-digits num)
71 (lambda (n-digits d-digits num)
90 (lambda (n-digits d-digits)
118 (stringify (lambda (v)
141 (lambda (a b) '?)))
/llvm-project/libcxx/test/std/numerics/rand/rand.dist/rand.dist.pois/rand.dist.pois.exp/
H A Deval.pass.cpp67 double x_mean = 1/d.lambda(); in main()
68 double x_var = 1/sqr(d.lambda()); in main()
106 double x_mean = 1/d.lambda(); in main()
107 double x_var = 1/sqr(d.lambda()); in main()
145 double x_mean = 1/d.lambda(); in main()
146 double x_var = 1/sqr(d.lambda()); in main()
/llvm-project/libcxx/include/__random/
H A Dexponential_distribution.h46 _LIBCPP_HIDE_FROM_ABI result_type lambda() const { return __lambda_; } in lambda() function
77 _LIBCPP_HIDE_FROM_ABI result_type lambda() const { return __p_.lambda(); } in lambda() function
100 __p.lambda(); in operator()
109 return __os << __x.lambda();
/llvm-project/llvm/test/Linker/
H A Dodr-lambda-1.ll1 ; ModuleID = '/tmp/odr-lambda-1.ii'
3 ; RUN: llvm-link %s %p/Inputs/odr-lambda-2.ll -S -o - 2>&1 | FileCheck %s
26 source_filename = "/tmp/odr-lambda-1.ii"
70 !1 = !DIFile(filename: "/tmp/odr-lambda-1.ii", directory: "/Data")
90 !21 = distinct !DISubprogram(name: "handleAllErrors<(lambda at /tmp/odr-lambda-1.ii:5:20)>", linkag…
/llvm-project/libc/test/src/__support/CPP/
H A Dtype_traits_test.cpp230 { // lambda in TEST()
234 const auto lambda = [](int) { return 0; }; in TEST()
235 EXPECT_EQ(invoke(lambda, 1), 0); in TEST()
259 auto lambda = []() {}; in TEST()
260 EXPECT_TRUE((is_same_v<invoke_result_t<decltype(lambda)>, void>)); in TEST()
263 auto lambda = []() { return 0; }; in TEST()
264 EXPECT_TRUE((is_same_v<invoke_result_t<decltype(lambda)>, int>)); in TEST()
267 auto lambda = [](int) -> double { return 0; }; in TEST()
268 EXPECT_TRUE((is_same_v<invoke_result_t<decltype(lambda), int>, double>)); in TEST()
232 const auto lambda = [](int) { return 0; }; TEST() local
257 auto lambda = []() {}; TEST() local
261 auto lambda = []() { return 0; }; TEST() local
265 auto lambda = [](int) -> double { return 0; }; TEST() local

12345678