Skip to content

Commit fe23efa

Browse files
committed
Add test for defaultable lambda with static variable
1 parent 4ea6445 commit fe23efa

1 file changed

Lines changed: 5 additions & 0 deletions

File tree

‎tests/unit/lambda_static_local.cpp‎

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
// ADDITIONAL_COMPILE_FLAGS: -std=c++23
12
// translation-fail
23
#include <assert.h>
34

@@ -15,6 +16,10 @@ int main() {
1516
assert(copy() == 3);
1617
assert(next() == 4);
1718

19+
decltype(next) fresh;
20+
assert(fresh() == 5);
21+
assert(next() == 6);
22+
1823
auto per_type = [](auto x) {
1924
static int calls = 0;
2025
calls++;

0 commit comments

Comments
 (0)