blob: 4608a4dc181b50fd8a7ebbe05d11f7bd330a6e56 [file] [log] [blame]
// Contracts shouldn't introduce more copies.
// { dg-do compile { target c++20 } }
// { dg-additional-options -fcontracts }
struct A
{
int i;
A(int i): i(i) { }
A(const A&) = delete;
};
A f(A a)
[[ pre: a.i > 0 ]]
[[ post r: r.i > 0 ]]
{
return {a.i};
}
int main()
{
if (f({42}).i != 42)
__builtin_abort ();
}