We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
2 parents 0fdd9c9 + bcc4b8a commit e85fb6eCopy full SHA for e85fb6e
gcc/cp/lambda.cc
@@ -464,6 +464,8 @@ build_capture_proxy (tree member, tree init)
464
init = PACK_EXPANSION_PATTERN (init);
465
}
466
467
+ init = strip_contract_const_wrapper (init);
468
+
469
if (INDIRECT_REF_P (init))
470
init = TREE_OPERAND (init, 0);
471
STRIP_NOPS (init);
gcc/testsuite/g++.dg/contracts/cpp26/lambda.C
@@ -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