Debian Codegraph @

gcc/testsuite/g++.dg/contracts/contracts-post5.C

raw
1 // { dg-do compile }
2 // { dg-options "-std=c++2a -fcontracts" }
3
4 // Tests for function templates
5
6 template<typename T>
7 T f1(T n)
8 [[pre: n >= 0]]
9 [[post r: r >= 0]]
10 [[post r: !(r < 0)]]
11 {
12 return n;
13 }
14
15
16 void driver()
17 {
18 f1(0);
19 }