// -*- C++ -*-
// Testing utilities for the rvalue reference.
//
-// Copyright (C) 2005-2016 Free Software Foundation, Inc.
+// Copyright (C) 2005-2024 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
rvalstruct(rvalstruct&& in)
{
- bool test __attribute__((unused)) = true;
VERIFY( in.valid == true );
val = in.val;
in.valid = false;
rvalstruct&
operator=(rvalstruct&& in)
{
- bool test __attribute__((unused)) = true;
VERIFY( this != &in );
VERIFY( in.valid == true );
val = in.val;
void
swap(rvalstruct& lhs, rvalstruct& rhs)
{
- bool test __attribute__((unused)) = true;
VERIFY( lhs.valid && rhs.valid );
int temp = lhs.val;
lhs.val = rhs.val;
copycounter(const copycounter& in) : val(in.val), valid(true)
{
- bool test __attribute__((unused)) = true;
VERIFY( in.valid == true );
++copycount;
}
copycounter(copycounter&& in) noexcept
{
- bool test __attribute__((unused)) = true;
VERIFY( in.valid == true );
val = in.val;
in.valid = false;
bool
operator=(const copycounter& in)
{
- bool test __attribute__((unused)) = true;
VERIFY( in.valid == true );
++copycount;
val = in.val;
copycounter&
operator=(copycounter&& in)
{
- bool test __attribute__((unused)) = true;
VERIFY(in.valid == true);
val = in.val;
in.valid = false;
inline void
swap(copycounter& lhs, copycounter& rhs)
{
- bool test __attribute__((unused)) = true;
VERIFY( lhs.valid && rhs.valid );
int temp = lhs.val;
lhs.val = rhs.val;
rvalstruct_compare_by_value(const rvalstruct_compare_by_value& rh)
: val(rh.val), ok(rh.ok)
{
- bool test __attribute__((unused)) = true;
VERIFY(rh.ok);
}
rvalstruct_compare_by_value&
operator=(const rvalstruct_compare_by_value& rh)
{
- bool test __attribute__((unused)) = true;
VERIFY( rh.ok );
val = rh.val;
ok = rh.ok;
rvalstruct_compare_by_value(rvalstruct_compare_by_value&& rh)
: val(rh.val), ok(rh.ok)
{
- bool test __attribute__((unused)) = true;
VERIFY( rh.ok );
rh.ok = false;
}
rvalstruct_compare_by_value&
operator=(rvalstruct_compare_by_value&& rh)
{
- bool test __attribute__((unused)) = true;
VERIFY( rh.ok );
val = rh.val;
ok = rh.ok;
operator<(rvalstruct_compare_by_value lh,
rvalstruct_compare_by_value rh)
{
- bool test __attribute__((unused)) = true;
VERIFY( rh.ok );
VERIFY( lh.ok );
return lh.val < rh.val;
order(rvalstruct_compare_by_value lh,
rvalstruct_compare_by_value rh)
{
- bool test __attribute__((unused)) = true;
VERIFY( rh.ok );
VERIFY( lh.ok );
return lh.val < rh.val;