// { dg-options "-std=gnu++17" }
-// { dg-do run }
+// { dg-do run { target c++17 } }
-// Copyright (C) 2014-2016 Free Software Foundation, Inc.
+// Copyright (C) 2014-2021 Free Software Foundation, Inc.
//
// This file is part of the GNU ISO C++ Library. This library is free
// software; you can redistribute it and/or modify it under the
any x;
any y;
y = x;
- VERIFY( x.empty() );
- VERIFY( y.empty() );
+ VERIFY( !x.has_value() );
+ VERIFY( !y.has_value() );
y = std::move(x);
- VERIFY( x.empty() );
- VERIFY( y.empty() );
+ VERIFY( !x.has_value() );
+ VERIFY( !y.has_value() );
}
void test02()
any x(1);
any y;
y = x;
- VERIFY( !x.empty() );
- VERIFY( !y.empty() );
+ VERIFY( x.has_value() );
+ VERIFY( y.has_value() );
x = std::move(y);
- VERIFY( !x.empty() );
- VERIFY( y.empty() );
+ VERIFY( x.has_value() );
+ VERIFY( !y.has_value() );
x = y;
- VERIFY( x.empty() );
- VERIFY( y.empty() );
+ VERIFY( !x.has_value() );
+ VERIFY( !y.has_value() );
}
int main()