Skip to content

Commit 7f29de4

Browse files
committed
ammending the test so it doesn't use a constructor
1 parent a28b943 commit 7f29de4

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

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

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3,17 +3,17 @@
33
// { dg-do compile }
44
// { dg-options "-std=c++2a -fcontracts" }
55

6+
struct Z {};
67

78
template<typename T>
8-
void fn()
9-
[[ pre: T{} ]] // { dg-error "no match" }
9+
void fn(T t)
10+
[[ pre: t ]] // { dg-error "could not convert" }
1011
{
1112
}
1213

13-
struct Z { };
1414

1515
int main(int, char**) {
16-
fn<int>();
17-
fn<Z>();
16+
fn(1);
17+
fn(Z{});
1818
return 0;
1919
}

0 commit comments

Comments
 (0)