File tree Expand file tree Collapse file tree 5 files changed +124
-0
lines changed Expand file tree Collapse file tree 5 files changed +124
-0
lines changed Original file line number Diff line number Diff line change @@ -2436,6 +2436,8 @@ void CodeGenerator::InsertArg(const AccessSpecDecl* stmt)
2436
2436
2437
2437
void CodeGenerator::InsertArg (const StaticAssertDecl* stmt)
2438
2438
{
2439
+ LAMBDA_SCOPE_HELPER (CallExpr);
2440
+
2439
2441
if (!stmt->isFailed ()) {
2440
2442
mOutputFormatHelper .Append (" /* PASSED: " sv);
2441
2443
} else {
Original file line number Diff line number Diff line change
1
+ // cmdline:-std=c++20
2
+
3
+ consteval bool ConstantFun ()
4
+ {
5
+ return true ;
6
+ }
7
+
8
+ static_assert (ConstantFun());
9
+
10
+ struct Test {
11
+ consteval bool Fun () { return true ; }
12
+ };
13
+
14
+ static_assert (Test{}.Fun());
15
+
16
+ static_assert ([]() consteval { return true ; }());
17
+
Original file line number Diff line number Diff line change
1
+ // cmdline:-std=c++20
2
+
3
+ inline consteval bool ConstantFun()
4
+ {
5
+ return true;
6
+ }
7
+
8
+
9
+ /* PASSED: static_assert(ConstantFun()); */
10
+
11
+
12
+ struct Test
13
+ {
14
+ inline consteval bool Fun()
15
+ {
16
+ return true;
17
+ }
18
+
19
+ };
20
+
21
+
22
+
23
+ /* PASSED: static_assert(Test{}.Fun()); */
24
+
25
+
26
+
27
+ class __lambda_16_15
28
+ {
29
+ public:
30
+ inline consteval bool operator()() const
31
+ {
32
+ return true;
33
+ }
34
+
35
+ using retType_16_15 = bool (*)();
36
+ inline /*constexpr */ operator retType_16_15 () const noexcept
37
+ {
38
+ return __invoke;
39
+ };
40
+
41
+ private:
42
+ static inline bool __invoke()
43
+ {
44
+ return true;
45
+ }
46
+
47
+
48
+ public:
49
+ // /*constexpr */ __lambda_16_15() = default;
50
+
51
+ } __lambda_16_15{};
52
+
53
+ /* PASSED: static_assert(__lambda_16_15.operator()()); */
54
+
55
+
Original file line number Diff line number Diff line change
1
+ // cmdline:-std=c++20
2
+
3
+ template <typename T>
4
+ concept C = true ;
5
+
6
+ auto lambda = [](C auto container) { };
7
+
8
+ int main () {
9
+ lambda (4 );
10
+ }
Original file line number Diff line number Diff line change
1
+ // cmdline:-std=c++20
2
+
3
+ template<typename T>
4
+ concept C = true;
5
+
6
+
7
+ class __lambda_6_15
8
+ {
9
+ public:
10
+ template<C type_parameter_0_0>
11
+ inline /*constexpr */ auto operator()(type_parameter_0_0 container) const
12
+ {
13
+ }
14
+
15
+ #ifdef INSIGHTS_USE_TEMPLATE
16
+ template<>
17
+ inline /*constexpr */ void operator()(int container) const
18
+ {
19
+ }
20
+ #endif
21
+
22
+ private:
23
+ template<C type_parameter_0_0>
24
+ static inline auto __invoke(type_parameter_0_0 container)
25
+ {
26
+ }
27
+
28
+ public:
29
+ // /*constexpr */ __lambda_6_15() = default;
30
+
31
+ };
32
+
33
+ __lambda_6_15 lambda = __lambda_6_15{};
34
+
35
+
36
+ int main()
37
+ {
38
+ lambda.operator()(4);
39
+ }
40
+
You can’t perform that action at this time.
0 commit comments