// Copyright (C) 2020-2025 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 // terms of the GNU General Public License as published by the // Free Software Foundation; either version 3, or (at your option) // any later version. // This library is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // You should have received a copy of the GNU General Public License along // with this library; see the file COPYING3. If not see // . // { dg-require-effective-target hosted } #include #include #include // PR libstdc++/92285 // See https://gcc.gnu.org/ml/libstdc++/2019-10/msg00129.html typedef std::input_iterator_tag category; typedef std::char_traits::off_type off_type; typedef std::iterator good; // { dg-warning "is deprecated" "" { target c++17 } } typedef std::iterator bad; // { dg-warning "is deprecated" "" { target c++17 } } bool check(good&) { return true; } void check(bad&) { } void test01() { typedef std::istreambuf_iterator I; I it; VERIFY( check(it) ); #if __cplusplus < 201103L char c = 'c'; I::reference r = c; VERIFY( &r == &c ); #else static_assert( std::is_same::value, "LWG 445" ); #endif } int main() { test01(); }