Skip to content

Commit e85fb6e

Browse files
Merge pull request gcc-mirror#86 from NinaRanns/contracts_ninaranns_issue6
fixing a lambda ICE
2 parents 0fdd9c9 + bcc4b8a commit e85fb6e

File tree

2 files changed

+7
-0
lines changed

2 files changed

+7
-0
lines changed

gcc/cp/lambda.cc

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -464,6 +464,8 @@ build_capture_proxy (tree member, tree init)
464464
init = PACK_EXPANSION_PATTERN (init);
465465
}
466466

467+
init = strip_contract_const_wrapper (init);
468+
467469
if (INDIRECT_REF_P (init))
468470
init = TREE_OPERAND (init, 0);
469471
STRIP_NOPS (init);
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
// check that we do not crash when capturing a constified entity in a contract assertion lambda
2+
// { dg-do compile }
3+
// { dg-options "-std=c++2b -fcontracts -fcontracts-nonattr " }
4+
void f(int i, int j) pre( [i, &j](){ return true;} ( ))
5+
{}

0 commit comments

Comments
 (0)