diff options
author | paolo <paolo@138bc75d-0d04-0410-961f-82ee72b054a4> | 2011-09-08 22:42:21 +0000 |
---|---|---|
committer | paolo <paolo@138bc75d-0d04-0410-961f-82ee72b054a4> | 2011-09-08 22:42:21 +0000 |
commit | 29a46dd8fad8ba58d065341e99b974acf204806c (patch) | |
tree | 98a006692f647c36217c82d976d6ef7092fb8156 /libstdc++-v3 | |
parent | ff367c5b39737ef610fb928e57ac6b01dcce1dda (diff) | |
download | gcc-29a46dd8fad8ba58d065341e99b974acf204806c.tar.gz |
2011-09-09 Paolo Carlini <paolo.carlini@oracle.com>
PR libstdc++/50336
* include/bits/streambuf_iterator.h (class istreambuf_iterator):
Implement LWG 445 in C++0x mode.
* testsuite/24_iterators/istreambuf_iterator/requirements/dr445.cc:
New.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@178713 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'libstdc++-v3')
-rw-r--r-- | libstdc++-v3/ChangeLog | 8 | ||||
-rw-r--r-- | libstdc++-v3/include/bits/streambuf_iterator.h | 8 | ||||
-rw-r--r-- | libstdc++-v3/testsuite/24_iterators/istreambuf_iterator/requirements/dr445.cc | 27 |
3 files changed, 42 insertions, 1 deletions
diff --git a/libstdc++-v3/ChangeLog b/libstdc++-v3/ChangeLog index d394f73ad1e..ac4215cc867 100644 --- a/libstdc++-v3/ChangeLog +++ b/libstdc++-v3/ChangeLog @@ -1,3 +1,11 @@ +2011-09-09 Paolo Carlini <paolo.carlini@oracle.com> + + PR libstdc++/50336 + * include/bits/streambuf_iterator.h (class istreambuf_iterator): + Implement LWG 445 in C++0x mode. + * testsuite/24_iterators/istreambuf_iterator/requirements/dr445.cc: + New. + 2011-09-08 Dodji Seketeli <dodji@redhat.com> PR c++/33255 - Support -Wunused-local-typedefs warning diff --git a/libstdc++-v3/include/bits/streambuf_iterator.h b/libstdc++-v3/include/bits/streambuf_iterator.h index 5540ca146b0..3c8014e89fa 100644 --- a/libstdc++-v3/include/bits/streambuf_iterator.h +++ b/libstdc++-v3/include/bits/streambuf_iterator.h @@ -51,7 +51,13 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION template<typename _CharT, typename _Traits> class istreambuf_iterator : public iterator<input_iterator_tag, _CharT, typename _Traits::off_type, - _CharT*, _CharT&> + _CharT*, +#ifdef __GXX_EXPERIMENTAL_CXX0X__ + // LWG 445. + _CharT> +#else + _CharT&> +#endif { public: // Types: diff --git a/libstdc++-v3/testsuite/24_iterators/istreambuf_iterator/requirements/dr445.cc b/libstdc++-v3/testsuite/24_iterators/istreambuf_iterator/requirements/dr445.cc new file mode 100644 index 00000000000..88d37bbf7b6 --- /dev/null +++ b/libstdc++-v3/testsuite/24_iterators/istreambuf_iterator/requirements/dr445.cc @@ -0,0 +1,27 @@ +// { dg-options "-std=gnu++0x" } +// { dg-do compile } + +// Copyright (C) 2011 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 +// <http://www.gnu.org/licenses/>. + +#include <type_traits> +#include <iterator> + +using namespace std; + +// DR 445 +static_assert(is_same<istreambuf_iterator<char>::reference, char>::value, ""); |