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.
1 parent b27844e commit a382c52Copy full SHA for a382c52
gcc/testsuite/g++.dg/contracts/cpp26/out-of-class-defn.C
@@ -0,0 +1,36 @@
1
+// { dg-options "-std=c++26 -fcontracts -fcontracts-nonattr" }
2
+
3
+struct F {
4
+ int a;
5
+ F (int b)
6
+ pre (b >= 0)
7
+ post (this->a > 10);
8
9
+ ~F () = default;
10
11
+ int swap (const int b)
12
+ pre (b > 5)
13
+ pre (a != 0)
14
+ post (a == b) ;
15
+};
16
17
+F::F (int b)
18
19
+ post (this->a > 10)
20
+ : a (b)
21
+{}
22
23
+int
24
+F::swap (const int b)
25
26
27
+ post (a == b)
28
+{ int x = a; a = b; return x; }
29
30
+#if 0
31
+int main ()
32
+{
33
+ F f{0};
34
+ f.swap (11);
35
+}
36
+#endif
0 commit comments