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 467e280 commit 150d27cCopy full SHA for 150d27c
gcc/testsuite/g++.dg/contracts/cpp26-attr/check-err.C
@@ -0,0 +1,15 @@
1
+// test that attribute syntax is diagnosed when using -fcontracts-nonattr
2
+// { dg-do compile }
3
+// { dg-options "-std=c++2a -fcontracts -fcontracts-nonattr" }
4
+
5
+int fun(int n) [[ pre : n > 0 ]]; // { dg-error "contracts are not available with" }
6
+int fun2(const int n) [[ post : n > 0 ]]; // { dg-error "contracts are not available with" }
7
8
+int main()
9
+{
10
+ int x;
11
12
+ [[assert: x >= 0]]; // { dg-error "ontracts are not available with" }
13
14
+ return 0;
15
+}
0 commit comments