Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

<iterator>: reduced parsing time #355

Merged
merged 1 commit into from
Dec 17, 2019
Merged

Conversation

Kojoley
Copy link
Contributor

@Kojoley Kojoley commented Dec 6, 2019

Description

  • Replaced <istream> include with <iosfwd> because [io]stream_iterator
    needs only basic_[io]stream forward declaration.
  • Moved [io]streambuf_iterator iterator definition to <iterator> because
    their definition has to come when <iterator> is included.
  • Include <iterator> in <xlocmon>, <xlocnum>, and <xloctime> as
    the [io]streambuf_iterator definition are required there, and <xutility>
    already included via other includes.

Parsing times (>1ms difference filter):

header msvc clang
<iterator> 232 -> 101 (-56.4%) 402 -> 176 (-56.2%)
<array> 247 -> 138 (-44.2%) 436 -> 238 (-45.4%)
<regex> 260 -> 257 ( -1.3%) 510 -> 498 ( -2.4%)
<functional> 131 -> 130 ( -1.0%) 232 -> 230 ( -0.9%)
<unordered_set> 184 -> 182 ( -0.7%) 317 -> 314 ( -0.9%)
<future> 395 -> 391 ( -0.8%) 684 -> 683 ( -0.1%)
<ostream> 228 -> 228 ( -0.3%) 393 -> 397 ( +1.0%)
<locale> 234 -> 234 ( -0.2%) 406 -> 410 ( +1.0%)
<fstream> 232 -> 232 ( -0.2%) 406 -> 412 ( +1.5%)
<strstream> 232 -> 233 ( +0.3%) 418 -> 423 ( +1.2%)
<iostream> 231 -> 233 ( +0.8%) 397 -> 401 ( +1.0%)
<sstream> 237 -> 238 ( +0.3%) 422 -> 429 ( +1.7%)
<codecvt> 235 -> 237 ( +0.7%) 403 -> 408 ( +1.2%)
<istream> 228 -> 230 ( +1.0%) 397 -> 401 ( +1.0%)
<iomanip> 237 -> 240 ( +1.0%) 413 -> 419 ( +1.5%)
<complex> 236 -> 240 ( +1.7%) 445 -> 449 ( +0.9%)

Checklist

Be sure you've read README.md and understand the scope of this repo.

If you're unsure about a box, leave it unchecked. A maintainer will help you.

  • Identifiers in product code changes are properly _Ugly as per
    https://eel.is/c++draft/lex.name#3.1 or there are no product code changes.
  • The STL builds successfully and all tests have passed (must be manually
    verified by an STL maintainer before automated testing is enabled on GitHub,
    leave this unchecked for initial submission).
  • These changes introduce no known ABI breaks (adding members, renaming
    members, adding virtual functions, changing whether a type is an aggregate
    or trivially copyable, etc.).
  • These changes were written from scratch using only this repository,
    the C++ Working Draft (including any cited standards), other WG21 papers
    (excluding reference implementations outside of proposed standard wording),
    and LWG issues as reference material. If they were derived from a project
    that's already listed in NOTICE.txt, that's fine, but please mention it.
    If they were derived from any other project (including Boost and libc++,
    which are not yet listed in NOTICE.txt), you must mention it here,
    so we can determine whether the license is compatible and what else needs
    to be done.

@Kojoley Kojoley requested a review from a team as a code owner December 6, 2019 16:42
Copy link
Member

@StephanTLavavej StephanTLavavej left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the compiler throughput measurements! I find that significant enough, and the scenario to be reasonable enough, for this to be worth the source breaking change. (I also hope that not too many people are depending on <iterator> dragging in <istream>.) I think we should merge this change, although we may need to revert it if it breaks too many "Real World Code" projects in our overall test suite.

@Kojoley
Copy link
Contributor Author

Kojoley commented Dec 6, 2019

For the reference, libstdc++ did the same thing gcc-mirror/gcc@e0d6537 (though they still pull bunch of unneeded stuff)

Copy link
Member

@CaseyCarter CaseyCarter left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I agree it's worth the effort to try to break this transitive include.

@BillyONeal BillyONeal self-assigned this Dec 6, 2019
@BillyONeal
Copy link
Member

I don't think this change actually works:

//===----------------------------------------------------------------------===//
//
// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
// See https://llvm.org/LICENSE.txt for license information.
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
//
//===----------------------------------------------------------------------===//

// <iterator>

// template<class charT, class traits = char_traits<charT> >
// class istreambuf_iterator
//     : public iterator<input_iterator_tag, charT,
//                       typename traits::off_type, unspecified,
//                       charT>
// {
// public:
//     typedef charT                         char_type;
//     typedef traits                        traits_type;
//     typedef typename traits::int_type     int_type;
//     typedef basic_streambuf<charT,traits> streambuf_type;
//     typedef basic_istream<charT,traits>   istream_type;
//     ...
//
// All specializations of istreambuf_iterator shall have a trivial copy constructor,
//    a constexpr default constructor and a trivial destructor.

#include <iterator>
#include <string>
#include <type_traits>

#include "test_macros.h"

int main(int, char**)
{
    typedef std::istreambuf_iterator<char> I1;
    static_assert((std::is_same<I1::iterator_category, std::input_iterator_tag>::value), "");
    static_assert((std::is_same<I1::value_type, char>::value), "");
    static_assert((std::is_same<I1::difference_type, std::char_traits<char>::off_type>::value), "");
    LIBCPP_STATIC_ASSERT((std::is_same<I1::pointer, char*>::value), "");
    static_assert((std::is_same<I1::reference, char>::value), "");
    static_assert((std::is_same<I1::char_type, char>::value), "");
    static_assert((std::is_same<I1::traits_type, std::char_traits<char> >::value), "");
    static_assert((std::is_same<I1::int_type, I1::traits_type::int_type>::value), "");
    static_assert((std::is_same<I1::streambuf_type, std::streambuf>::value), "");
    static_assert((std::is_same<I1::istream_type, std::istream>::value), "");
    static_assert((std::is_nothrow_default_constructible<I1>::value), "" );
    static_assert((std::is_trivially_copy_constructible<I1>::value), "" );
    static_assert((std::is_trivially_destructible<I1>::value), "" );

    typedef std::istreambuf_iterator<wchar_t> I2;
    static_assert((std::is_same<I2::iterator_category, std::input_iterator_tag>::value), "");
    static_assert((std::is_same<I2::value_type, wchar_t>::value), "");
    static_assert((std::is_same<I2::difference_type, std::char_traits<wchar_t>::off_type>::value), "");
    LIBCPP_STATIC_ASSERT((std::is_same<I2::pointer, wchar_t*>::value), "");
    static_assert((std::is_same<I2::reference, wchar_t>::value), "");
    static_assert((std::is_same<I2::char_type, wchar_t>::value), "");
    static_assert((std::is_same<I2::traits_type, std::char_traits<wchar_t> >::value), "");
    static_assert((std::is_same<I2::int_type, I2::traits_type::int_type>::value), "");
    static_assert((std::is_same<I2::streambuf_type, std::wstreambuf>::value), "");
    static_assert((std::is_same<I2::istream_type, std::wistream>::value), "");
    static_assert((std::is_nothrow_default_constructible<I2>::value), "" );
    static_assert((std::is_trivially_copy_constructible<I2>::value), "" );
    static_assert((std::is_trivially_destructible<I2>::value), "" );

  return 0;
}

since istreambuf_iterator is required to be defined in <iterator>.

failure: BION-TR libcxx upstream\test\std\iterators\stream.iterators\istreambuf.iterator types.pass.cpp cl /nologo /Od /W4 /w14061 /w14242 /w14582 /w14583 /w14587 /w14588 /w14265 /w14749 /w14841 /w14842 /w15038 /wd4643 /sdl /WX /Zc:strictStrings /D_ENABLE_STL_INTERNAL_CHECK /bigobj /FImsvc_stdlib_force_include.h /permissive- /EHsc /MTd /D_ITERATOR_DEBUG_LEVEL=2 /std:c++latest /analyze
### Compile: "C:\Dev\msvc\binaries\x86ret\bin\i386\cl.exe" /FeC:\Dev\msvc\Temp\libcxx\DDFAE2AE1D1DBC5B5D50270234F7161C42CD2B1FAD2A434548C49D321E40E40C\types.pass.exe /FoC:\Dev\msvc\Temp\libcxx\DDFAE2AE1D1DBC5B5D50270234F7161C42CD2B1FAD2A434548C49D321E40E40C\types.pass.obj C:\Dev\msvc\src\qa\vc\libs\libcxx\upstream\test\std\iterators\stream.iterators\istreambuf.iterator\types.pass.cpp /nologo /Od /W4 /w14061 /w14242 /w14582 /w14583 /w14587 /w14588 /w14265 /w14749 /w14841 /w14842 /w15038 /wd4643 /sdl /WX /Zc:strictStrings /D_ENABLE_STL_INTERNAL_CHECK /bigobj /FImsvc_stdlib_force_include.h /permissive- /EHsc /MTd /D_ITERATOR_DEBUG_LEVEL=2 /std:c++latest /analyze
### Working directory: C:\Dev\msvc\src\qa\vc\libs\libcxx\upstream\test\std\iterators\stream.iterators\istreambuf.iterator
### Compile took 0:00:00:03.8040158
types.pass.cpp
C:\Dev\msvc\src\qa\vc\libs\libcxx\upstream\test\std\iterators\stream.iterators\istreambuf.iterator\types.pass.cpp(37): error C2027: use of undefined type 'std::istreambuf_iterator<char,std::char_traits<char>>'
C:\Dev\msvc\src\qa\vc\libs\libcxx\upstream\test\std\iterators\stream.iterators\istreambuf.iterator\types.pass.cpp(36): note: see declaration of 'std::istreambuf_iterator<char,std::char_traits<char>>'
C:\Dev\msvc\src\qa\vc\libs\libcxx\upstream\test\std\iterators\stream.iterators\istreambuf.iterator\types.pass.cpp(37): error C2065: 'iterator_category': undeclared identifier
C:\Dev\msvc\src\qa\vc\libs\libcxx\upstream\test\std\iterators\stream.iterators\istreambuf.iterator\types.pass.cpp(37): error C2923: 'std::is_same': 'iterator_category' is not a valid template type argument for parameter '_Ty1'
C:\Dev\msvc\src\qa\vc\libs\libcxx\upstream\test\std\iterators\stream.iterators\istreambuf.iterator\types.pass.cpp(37): error C2955: 'std::is_same': use of class template requires template argument list
C:\Dev\msvc\binaries\x86ret\inc\xtr1common(84): note: see declaration of 'std::is_same'
C:\Dev\msvc\src\qa\vc\libs\libcxx\upstream\test\std\iterators\stream.iterators\istreambuf.iterator\types.pass.cpp(37): error C2039: 'value': is not a member of 'std::is_same<_Ty1,_Ty2>'
C:\Dev\msvc\src\qa\vc\libs\libcxx\upstream\test\std\iterators\stream.iterators\istreambuf.iterator\types.pass.cpp(37): error C2065: 'value': undeclared identifier
C:\Dev\msvc\src\qa\vc\libs\libcxx\upstream\test\std\iterators\stream.iterators\istreambuf.iterator\types.pass.cpp(38): error C2027: use of undefined type 'std::istreambuf_iterator<char,std::char_traits<char>>'
C:\Dev\msvc\src\qa\vc\libs\libcxx\upstream\test\std\iterators\stream.iterators\istreambuf.iterator\types.pass.cpp(36): note: see declaration of 'std::istreambuf_iterator<char,std::char_traits<char>>'
C:\Dev\msvc\src\qa\vc\libs\libcxx\upstream\test\std\iterators\stream.iterators\istreambuf.iterator\types.pass.cpp(38): error C2065: 'value_type': undeclared identifier
C:\Dev\msvc\src\qa\vc\libs\libcxx\upstream\test\std\iterators\stream.iterators\istreambuf.iterator\types.pass.cpp(38): error C2923: 'std::is_same': 'value_type' is not a valid template type argument for parameter '_Ty1'
C:\Dev\msvc\src\qa\vc\libs\libcxx\upstream\test\std\iterators\stream.iterators\istreambuf.iterator\types.pass.cpp(38): error C2955: 'std::is_same': use of class template requires template argument list
C:\Dev\msvc\binaries\x86ret\inc\xtr1common(84): note: see declaration of 'std::is_same'
C:\Dev\msvc\src\qa\vc\libs\libcxx\upstream\test\std\iterators\stream.iterators\istreambuf.iterator\types.pass.cpp(38): error C2039: 'value': is not a member of 'std::is_same<_Ty1,_Ty2>'
C:\Dev\msvc\src\qa\vc\libs\libcxx\upstream\test\std\iterators\stream.iterators\istreambuf.iterator\types.pass.cpp(38): error C2065: 'value': undeclared identifier
C:\Dev\msvc\src\qa\vc\libs\libcxx\upstream\test\std\iterators\stream.iterators\istreambuf.iterator\types.pass.cpp(39): error C2027: use of undefined type 'std::istreambuf_iterator<char,std::char_traits<char>>'
C:\Dev\msvc\src\qa\vc\libs\libcxx\upstream\test\std\iterators\stream.iterators\istreambuf.iterator\types.pass.cpp(36): note: see declaration of 'std::istreambuf_iterator<char,std::char_traits<char>>'
C:\Dev\msvc\src\qa\vc\libs\libcxx\upstream\test\std\iterators\stream.iterators\istreambuf.iterator\types.pass.cpp(39): error C2065: 'difference_type': undeclared identifier
C:\Dev\msvc\src\qa\vc\libs\libcxx\upstream\test\std\iterators\stream.iterators\istreambuf.iterator\types.pass.cpp(39): error C2923: 'std::is_same': 'difference_type' is not a valid template type argument for parameter '_Ty1'
C:\Dev\msvc\src\qa\vc\libs\libcxx\upstream\test\std\iterators\stream.iterators\istreambuf.iterator\types.pass.cpp(39): error C2955: 'std::is_same': use of class template requires template argument list
C:\Dev\msvc\binaries\x86ret\inc\xtr1common(84): note: see declaration of 'std::is_same'
C:\Dev\msvc\src\qa\vc\libs\libcxx\upstream\test\std\iterators\stream.iterators\istreambuf.iterator\types.pass.cpp(39): error C2039: 'value': is not a member of 'std::is_same<_Ty1,_Ty2>'
C:\Dev\msvc\src\qa\vc\libs\libcxx\upstream\test\std\iterators\stream.iterators\istreambuf.iterator\types.pass.cpp(39): error C2065: 'value': undeclared identifier
C:\Dev\msvc\src\qa\vc\libs\libcxx\upstream\test\std\iterators\stream.iterators\istreambuf.iterator\types.pass.cpp(41): error C2027: use of undefined type 'std::istreambuf_iterator<char,std::char_traits<char>>'
C:\Dev\msvc\src\qa\vc\libs\libcxx\upstream\test\std\iterators\stream.iterators\istreambuf.iterator\types.pass.cpp(36): note: see declaration of 'std::istreambuf_iterator<char,std::char_traits<char>>'
C:\Dev\msvc\src\qa\vc\libs\libcxx\upstream\test\std\iterators\stream.iterators\istreambuf.iterator\types.pass.cpp(41): error C2065: 'reference': undeclared identifier
C:\Dev\msvc\src\qa\vc\libs\libcxx\upstream\test\std\iterators\stream.iterators\istreambuf.iterator\types.pass.cpp(41): error C2923: 'std::is_same': 'reference' is not a valid template type argument for parameter '_Ty1'
C:\Dev\msvc\src\qa\vc\libs\libcxx\upstream\test\std\iterators\stream.iterators\istreambuf.iterator\types.pass.cpp(41): error C2955: 'std::is_same': use of class template requires template argument list
C:\Dev\msvc\binaries\x86ret\inc\xtr1common(84): note: see declaration of 'std::is_same'
C:\Dev\msvc\src\qa\vc\libs\libcxx\upstream\test\std\iterators\stream.iterators\istreambuf.iterator\types.pass.cpp(41): error C2039: 'value': is not a member of 'std::is_same<_Ty1,_Ty2>'
C:\Dev\msvc\src\qa\vc\libs\libcxx\upstream\test\std\iterators\stream.iterators\istreambuf.iterator\types.pass.cpp(41): error C2065: 'value': undeclared identifier
C:\Dev\msvc\src\qa\vc\libs\libcxx\upstream\test\std\iterators\stream.iterators\istreambuf.iterator\types.pass.cpp(42): error C2027: use of undefined type 'std::istreambuf_iterator<char,std::char_traits<char>>'
C:\Dev\msvc\src\qa\vc\libs\libcxx\upstream\test\std\iterators\stream.iterators\istreambuf.iterator\types.pass.cpp(36): note: see declaration of 'std::istreambuf_iterator<char,std::char_traits<char>>'
C:\Dev\msvc\src\qa\vc\libs\libcxx\upstream\test\std\iterators\stream.iterators\istreambuf.iterator\types.pass.cpp(42): error C2065: 'char_type': undeclared identifier
C:\Dev\msvc\src\qa\vc\libs\libcxx\upstream\test\std\iterators\stream.iterators\istreambuf.iterator\types.pass.cpp(42): error C2923: 'std::is_same': 'char_type' is not a valid template type argument for parameter '_Ty1'
C:\Dev\msvc\src\qa\vc\libs\libcxx\upstream\test\std\iterators\stream.iterators\istreambuf.iterator\types.pass.cpp(42): error C2955: 'std::is_same': use of class template requires template argument list
C:\Dev\msvc\binaries\x86ret\inc\xtr1common(84): note: see declaration of 'std::is_same'
C:\Dev\msvc\src\qa\vc\libs\libcxx\upstream\test\std\iterators\stream.iterators\istreambuf.iterator\types.pass.cpp(42): error C2039: 'value': is not a member of 'std::is_same<_Ty1,_Ty2>'
C:\Dev\msvc\src\qa\vc\libs\libcxx\upstream\test\std\iterators\stream.iterators\istreambuf.iterator\types.pass.cpp(42): error C2065: 'value': undeclared identifier
C:\Dev\msvc\src\qa\vc\libs\libcxx\upstream\test\std\iterators\stream.iterators\istreambuf.iterator\types.pass.cpp(43): error C2027: use of undefined type 'std::istreambuf_iterator<char,std::char_traits<char>>'
C:\Dev\msvc\src\qa\vc\libs\libcxx\upstream\test\std\iterators\stream.iterators\istreambuf.iterator\types.pass.cpp(36): note: see declaration of 'std::istreambuf_iterator<char,std::char_traits<char>>'
C:\Dev\msvc\src\qa\vc\libs\libcxx\upstream\test\std\iterators\stream.iterators\istreambuf.iterator\types.pass.cpp(43): error C2065: 'traits_type': undeclared identifier
C:\Dev\msvc\src\qa\vc\libs\libcxx\upstream\test\std\iterators\stream.iterators\istreambuf.iterator\types.pass.cpp(43): error C2923: 'std::is_same': 'traits_type' is not a valid template type argument for parameter '_Ty1'
C:\Dev\msvc\src\qa\vc\libs\libcxx\upstream\test\std\iterators\stream.iterators\istreambuf.iterator\types.pass.cpp(43): error C2955: 'std::is_same': use of class template requires template argument list
C:\Dev\msvc\binaries\x86ret\inc\xtr1common(84): note: see declaration of 'std::is_same'
C:\Dev\msvc\src\qa\vc\libs\libcxx\upstream\test\std\iterators\stream.iterators\istreambuf.iterator\types.pass.cpp(43): error C2039: 'value': is not a member of 'std::is_same<_Ty1,_Ty2>'
C:\Dev\msvc\src\qa\vc\libs\libcxx\upstream\test\std\iterators\stream.iterators\istreambuf.iterator\types.pass.cpp(43): error C2065: 'value': undeclared identifier
C:\Dev\msvc\src\qa\vc\libs\libcxx\upstream\test\std\iterators\stream.iterators\istreambuf.iterator\types.pass.cpp(44): error C2027: use of undefined type 'std::istreambuf_iterator<char,std::char_traits<char>>'
C:\Dev\msvc\src\qa\vc\libs\libcxx\upstream\test\std\iterators\stream.iterators\istreambuf.iterator\types.pass.cpp(36): note: see declaration of 'std::istreambuf_iterator<char,std::char_traits<char>>'
C:\Dev\msvc\src\qa\vc\libs\libcxx\upstream\test\std\iterators\stream.iterators\istreambuf.iterator\types.pass.cpp(44): error C2065: 'int_type': undeclared identifier
C:\Dev\msvc\src\qa\vc\libs\libcxx\upstream\test\std\iterators\stream.iterators\istreambuf.iterator\types.pass.cpp(44): error C2027: use of undefined type 'std::istreambuf_iterator<char,std::char_traits<char>>'
C:\Dev\msvc\src\qa\vc\libs\libcxx\upstream\test\std\iterators\stream.iterators\istreambuf.iterator\types.pass.cpp(36): note: see declaration of 'std::istreambuf_iterator<char,std::char_traits<char>>'
C:\Dev\msvc\src\qa\vc\libs\libcxx\upstream\test\std\iterators\stream.iterators\istreambuf.iterator\types.pass.cpp(44): error C2065: 'int_type': undeclared identifier
C:\Dev\msvc\src\qa\vc\libs\libcxx\upstream\test\std\iterators\stream.iterators\istreambuf.iterator\types.pass.cpp(44): error C2923: 'std::is_same': 'int_type' is not a valid template type argument for parameter '_Ty1'
C:\Dev\msvc\src\qa\vc\libs\libcxx\upstream\test\std\iterators\stream.iterators\istreambuf.iterator\types.pass.cpp(44): error C2923: 'std::is_same': 'int_type' is not a valid template type argument for parameter '_Ty2'
C:\Dev\msvc\src\qa\vc\libs\libcxx\upstream\test\std\iterators\stream.iterators\istreambuf.iterator\types.pass.cpp(44): error C2955: 'std::is_same': use of class template requires template argument list
C:\Dev\msvc\binaries\x86ret\inc\xtr1common(84): note: see declaration of 'std::is_same'
C:\Dev\msvc\src\qa\vc\libs\libcxx\upstream\test\std\iterators\stream.iterators\istreambuf.iterator\types.pass.cpp(44): error C2039: 'value': is not a member of 'std::is_same<_Ty1,_Ty2>'
C:\Dev\msvc\src\qa\vc\libs\libcxx\upstream\test\std\iterators\stream.iterators\istreambuf.iterator\types.pass.cpp(44): error C2065: 'value': undeclared identifier
C:\Dev\msvc\src\qa\vc\libs\libcxx\upstream\test\std\iterators\stream.iterators\istreambuf.iterator\types.pass.cpp(45): error C2027: use of undefined type 'std::istreambuf_iterator<char,std::char_traits<char>>'
C:\Dev\msvc\src\qa\vc\libs\libcxx\upstream\test\std\iterators\stream.iterators\istreambuf.iterator\types.pass.cpp(36): note: see declaration of 'std::istreambuf_iterator<char,std::char_traits<char>>'
C:\Dev\msvc\src\qa\vc\libs\libcxx\upstream\test\std\iterators\stream.iterators\istreambuf.iterator\types.pass.cpp(45): error C2065: 'streambuf_type': undeclared identifier
C:\Dev\msvc\src\qa\vc\libs\libcxx\upstream\test\std\iterators\stream.iterators\istreambuf.iterator\types.pass.cpp(45): error C2923: 'std::is_same': 'streambuf_type' is not a valid template type argument for parameter '_Ty1'
C:\Dev\msvc\src\qa\vc\libs\libcxx\upstream\test\std\iterators\stream.iterators\istreambuf.iterator\types.pass.cpp(45): error C2955: 'std::is_same': use of class template requires template argument list
C:\Dev\msvc\binaries\x86ret\inc\xtr1common(84): note: see declaration of 'std::is_same'
C:\Dev\msvc\src\qa\vc\libs\libcxx\upstream\test\std\iterators\stream.iterators\istreambuf.iterator\types.pass.cpp(45): error C2039: 'value': is not a member of 'std::is_same<_Ty1,_Ty2>'
C:\Dev\msvc\src\qa\vc\libs\libcxx\upstream\test\std\iterators\stream.iterators\istreambuf.iterator\types.pass.cpp(45): error C2065: 'value': undeclared identifier
C:\Dev\msvc\src\qa\vc\libs\libcxx\upstream\test\std\iterators\stream.iterators\istreambuf.iterator\types.pass.cpp(46): error C2027: use of undefined type 'std::istreambuf_iterator<char,std::char_traits<char>>'
C:\Dev\msvc\src\qa\vc\libs\libcxx\upstream\test\std\iterators\stream.iterators\istreambuf.iterator\types.pass.cpp(36): note: see declaration of 'std::istreambuf_iterator<char,std::char_traits<char>>'
C:\Dev\msvc\src\qa\vc\libs\libcxx\upstream\test\std\iterators\stream.iterators\istreambuf.iterator\types.pass.cpp(46): error C2065: 'istream_type': undeclared identifier
C:\Dev\msvc\src\qa\vc\libs\libcxx\upstream\test\std\iterators\stream.iterators\istreambuf.iterator\types.pass.cpp(46): error C2923: 'std::is_same': 'istream_type' is not a valid template type argument for parameter '_Ty1'
C:\Dev\msvc\src\qa\vc\libs\libcxx\upstream\test\std\iterators\stream.iterators\istreambuf.iterator\types.pass.cpp(46): error C2955: 'std::is_same': use of class template requires template argument list
C:\Dev\msvc\binaries\x86ret\inc\xtr1common(84): note: see declaration of 'std::is_same'
C:\Dev\msvc\src\qa\vc\libs\libcxx\upstream\test\std\iterators\stream.iterators\istreambuf.iterator\types.pass.cpp(46): error C2039: 'value': is not a member of 'std::is_same<_Ty1,_Ty2>'
C:\Dev\msvc\src\qa\vc\libs\libcxx\upstream\test\std\iterators\stream.iterators\istreambuf.iterator\types.pass.cpp(46): error C2065: 'value': undeclared identifier
C:\Dev\msvc\binaries\x86ret\inc\type_traits(848): error C2139: 'std::istreambuf_iterator<char,std::char_traits<char>>': an undefined class is not allowed as an argument to compiler intrinsic type trait '__is_nothrow_constructible'
C:\Dev\msvc\src\qa\vc\libs\libcxx\upstream\test\std\iterators\stream.iterators\istreambuf.iterator\types.pass.cpp(36): note: see declaration of 'std::istreambuf_iterator<char,std::char_traits<char>>'
C:\Dev\msvc\src\qa\vc\libs\libcxx\upstream\test\std\iterators\stream.iterators\istreambuf.iterator\types.pass.cpp(47): note: see reference to class template instantiation 'std::is_nothrow_default_constructible<I1>' being compiled
C:\Dev\msvc\src\qa\vc\libs\libcxx\upstream\test\std\iterators\stream.iterators\istreambuf.iterator\types.pass.cpp(47): error C2338: 
C:\Dev\msvc\binaries\x86ret\inc\type_traits(760): error C2139: 'std::istreambuf_iterator<char,std::char_traits<char>>': an undefined class is not allowed as an argument to compiler intrinsic type trait '__is_trivially_constructible'
C:\Dev\msvc\src\qa\vc\libs\libcxx\upstream\test\std\iterators\stream.iterators\istreambuf.iterator\types.pass.cpp(36): note: see declaration of 'std::istreambuf_iterator<char,std::char_traits<char>>'
C:\Dev\msvc\src\qa\vc\libs\libcxx\upstream\test\std\iterators\stream.iterators\istreambuf.iterator\types.pass.cpp(48): note: see reference to class template instantiation 'std::is_trivially_copy_constructible<I1>' being compiled
C:\Dev\msvc\src\qa\vc\libs\libcxx\upstream\test\std\iterators\stream.iterators\istreambuf.iterator\types.pass.cpp(48): error C2338: 
C:\Dev\msvc\binaries\x86ret\inc\type_traits(817): error C2139: 'std::istreambuf_iterator<char,std::char_traits<char>>': an undefined class is not allowed as an argument to compiler intrinsic type trait '__is_trivially_destructible'
C:\Dev\msvc\src\qa\vc\libs\libcxx\upstream\test\std\iterators\stream.iterators\istreambuf.iterator\types.pass.cpp(36): note: see declaration of 'std::istreambuf_iterator<char,std::char_traits<char>>'
C:\Dev\msvc\src\qa\vc\libs\libcxx\upstream\test\std\iterators\stream.iterators\istreambuf.iterator\types.pass.cpp(49): note: see reference to class template instantiation 'std::is_trivially_destructible<I1>' being compiled
C:\Dev\msvc\src\qa\vc\libs\libcxx\upstream\test\std\iterators\stream.iterators\istreambuf.iterator\types.pass.cpp(49): error C2338: 
C:\Dev\msvc\src\qa\vc\libs\libcxx\upstream\test\std\iterators\stream.iterators\istreambuf.iterator\types.pass.cpp(52): error C2027: use of undefined type 'std::istreambuf_iterator<wchar_t,std::char_traits<wchar_t>>'
C:\Dev\msvc\src\qa\vc\libs\libcxx\upstream\test\std\iterators\stream.iterators\istreambuf.iterator\types.pass.cpp(51): note: see declaration of 'std::istreambuf_iterator<wchar_t,std::char_traits<wchar_t>>'
C:\Dev\msvc\src\qa\vc\libs\libcxx\upstream\test\std\iterators\stream.iterators\istreambuf.iterator\types.pass.cpp(52): error C2065: 'iterator_category': undeclared identifier
C:\Dev\msvc\src\qa\vc\libs\libcxx\upstream\test\std\iterators\stream.iterators\istreambuf.iterator\types.pass.cpp(52): error C2923: 'std::is_same': 'iterator_category' is not a valid template type argument for parameter '_Ty1'
C:\Dev\msvc\src\qa\vc\libs\libcxx\upstream\test\std\iterators\stream.iterators\istreambuf.iterator\types.pass.cpp(52): error C2955: 'std::is_same': use of class template requires template argument list
C:\Dev\msvc\binaries\x86ret\inc\xtr1common(84): note: see declaration of 'std::is_same'
C:\Dev\msvc\src\qa\vc\libs\libcxx\upstream\test\std\iterators\stream.iterators\istreambuf.iterator\types.pass.cpp(52): error C2039: 'value': is not a member of 'std::is_same<_Ty1,_Ty2>'
C:\Dev\msvc\src\qa\vc\libs\libcxx\upstream\test\std\iterators\stream.iterators\istreambuf.iterator\types.pass.cpp(52): error C2065: 'value': undeclared identifier
C:\Dev\msvc\src\qa\vc\libs\libcxx\upstream\test\std\iterators\stream.iterators\istreambuf.iterator\types.pass.cpp(53): error C2027: use of undefined type 'std::istreambuf_iterator<wchar_t,std::char_traits<wchar_t>>'
C:\Dev\msvc\src\qa\vc\libs\libcxx\upstream\test\std\iterators\stream.iterators\istreambuf.iterator\types.pass.cpp(51): note: see declaration of 'std::istreambuf_iterator<wchar_t,std::char_traits<wchar_t>>'
C:\Dev\msvc\src\qa\vc\libs\libcxx\upstream\test\std\iterators\stream.iterators\istreambuf.iterator\types.pass.cpp(53): error C2065: 'value_type': undeclared identifier
C:\Dev\msvc\src\qa\vc\libs\libcxx\upstream\test\std\iterators\stream.iterators\istreambuf.iterator\types.pass.cpp(53): error C2923: 'std::is_same': 'value_type' is not a valid template type argument for parameter '_Ty1'
C:\Dev\msvc\src\qa\vc\libs\libcxx\upstream\test\std\iterators\stream.iterators\istreambuf.iterator\types.pass.cpp(53): error C2955: 'std::is_same': use of class template requires template argument list
C:\Dev\msvc\binaries\x86ret\inc\xtr1common(84): note: see declaration of 'std::is_same'
C:\Dev\msvc\src\qa\vc\libs\libcxx\upstream\test\std\iterators\stream.iterators\istreambuf.iterator\types.pass.cpp(53): error C2039: 'value': is not a member of 'std::is_same<_Ty1,_Ty2>'
C:\Dev\msvc\src\qa\vc\libs\libcxx\upstream\test\std\iterators\stream.iterators\istreambuf.iterator\types.pass.cpp(53): error C2065: 'value': undeclared identifier
C:\Dev\msvc\src\qa\vc\libs\libcxx\upstream\test\std\iterators\stream.iterators\istreambuf.iterator\types.pass.cpp(54): error C2027: use of undefined type 'std::istreambuf_iterator<wchar_t,std::char_traits<wchar_t>>'
C:\Dev\msvc\src\qa\vc\libs\libcxx\upstream\test\std\iterators\stream.iterators\istreambuf.iterator\types.pass.cpp(51): note: see declaration of 'std::istreambuf_iterator<wchar_t,std::char_traits<wchar_t>>'
C:\Dev\msvc\src\qa\vc\libs\libcxx\upstream\test\std\iterators\stream.iterators\istreambuf.iterator\types.pass.cpp(54): error C2065: 'difference_type': undeclared identifier
C:\Dev\msvc\src\qa\vc\libs\libcxx\upstream\test\std\iterators\stream.iterators\istreambuf.iterator\types.pass.cpp(54): error C2923: 'std::is_same': 'difference_type' is not a valid template type argument for parameter '_Ty1'
C:\Dev\msvc\src\qa\vc\libs\libcxx\upstream\test\std\iterators\stream.iterators\istreambuf.iterator\types.pass.cpp(54): error C2955: 'std::is_same': use of class template requires template argument list
C:\Dev\msvc\binaries\x86ret\inc\xtr1common(84): note: see declaration of 'std::is_same'
C:\Dev\msvc\src\qa\vc\libs\libcxx\upstream\test\std\iterators\stream.iterators\istreambuf.iterator\types.pass.cpp(54): error C2039: 'value': is not a member of 'std::is_same<_Ty1,_Ty2>'
C:\Dev\msvc\src\qa\vc\libs\libcxx\upstream\test\std\iterators\stream.iterators\istreambuf.iterator\types.pass.cpp(54): error C2065: 'value': undeclared identifier
C:\Dev\msvc\src\qa\vc\libs\libcxx\upstream\test\std\iterators\stream.iterators\istreambuf.iterator\types.pass.cpp(56): error C2027: use of undefined type 'std::istreambuf_iterator<wchar_t,std::char_traits<wchar_t>>'
C:\Dev\msvc\src\qa\vc\libs\libcxx\upstream\test\std\iterators\stream.iterators\istreambuf.iterator\types.pass.cpp(51): note: see declaration of 'std::istreambuf_iterator<wchar_t,std::char_traits<wchar_t>>'
C:\Dev\msvc\src\qa\vc\libs\libcxx\upstream\test\std\iterators\stream.iterators\istreambuf.iterator\types.pass.cpp(56): error C2065: 'reference': undeclared identifier
C:\Dev\msvc\src\qa\vc\libs\libcxx\upstream\test\std\iterators\stream.iterators\istreambuf.iterator\types.pass.cpp(56): error C2923: 'std::is_same': 'reference' is not a valid template type argument for parameter '_Ty1'
C:\Dev\msvc\src\qa\vc\libs\libcxx\upstream\test\std\iterators\stream.iterators\istreambuf.iterator\types.pass.cpp(56): error C2955: 'std::is_same': use of class template requires template argument list
C:\Dev\msvc\binaries\x86ret\inc\xtr1common(84): note: see declaration of 'std::is_same'
C:\Dev\msvc\src\qa\vc\libs\libcxx\upstream\test\std\iterators\stream.iterators\istreambuf.iterator\types.pass.cpp(56): error C2039: 'value': is not a member of 'std::is_same<_Ty1,_Ty2>'
C:\Dev\msvc\src\qa\vc\libs\libcxx\upstream\test\std\iterators\stream.iterators\istreambuf.iterator\types.pass.cpp(56): error C2065: 'value': undeclared identifier
C:\Dev\msvc\src\qa\vc\libs\libcxx\upstream\test\std\iterators\stream.iterators\istreambuf.iterator\types.pass.cpp(57): error C2027: use of undefined type 'std::istreambuf_iterator<wchar_t,std::char_traits<wchar_t>>'
C:\Dev\msvc\src\qa\vc\libs\libcxx\upstream\test\std\iterators\stream.iterators\istreambuf.iterator\types.pass.cpp(51): note: see declaration of 'std::istreambuf_iterator<wchar_t,std::char_traits<wchar_t>>'
C:\Dev\msvc\src\qa\vc\libs\libcxx\upstream\test\std\iterators\stream.iterators\istreambuf.iterator\types.pass.cpp(57): error C2065: 'char_type': undeclared identifier
C:\Dev\msvc\src\qa\vc\libs\libcxx\upstream\test\std\iterators\stream.iterators\istreambuf.iterator\types.pass.cpp(57): error C2923: 'std::is_same': 'char_type' is not a valid template type argument for parameter '_Ty1'
C:\Dev\msvc\src\qa\vc\libs\libcxx\upstream\test\std\iterators\stream.iterators\istreambuf.iterator\types.pass.cpp(57): error C2955: 'std::is_same': use of class template requires template argument list
C:\Dev\msvc\binaries\x86ret\inc\xtr1common(84): note: see declaration of 'std::is_same'
C:\Dev\msvc\src\qa\vc\libs\libcxx\upstream\test\std\iterators\stream.iterators\istreambuf.iterator\types.pass.cpp(57): error C2039: 'value': is not a member of 'std::is_same<_Ty1,_Ty2>'
C:\Dev\msvc\src\qa\vc\libs\libcxx\upstream\test\std\iterators\stream.iterators\istreambuf.iterator\types.pass.cpp(57): error C2065: 'value': undeclared identifier
C:\Dev\msvc\src\qa\vc\libs\libcxx\upstream\test\std\iterators\stream.iterators\istreambuf.iterator\types.pass.cpp(58): error C2027: use of undefined type 'std::istreambuf_iterator<wchar_t,std::char_traits<wchar_t>>'
C:\Dev\msvc\src\qa\vc\libs\libcxx\upstream\test\std\iterators\stream.iterators\istreambuf.iterator\types.pass.cpp(51): note: see declaration of 'std::istreambuf_iterator<wchar_t,std::char_traits<wchar_t>>'
C:\Dev\msvc\src\qa\vc\libs\libcxx\upstream\test\std\iterators\stream.iterators\istreambuf.iterator\types.pass.cpp(58): error C2065: 'traits_type': undeclared identifier
C:\Dev\msvc\src\qa\vc\libs\libcxx\upstream\test\std\iterators\stream.iterators\istreambuf.iterator\types.pass.cpp(58): error C2923: 'std::is_same': 'traits_type' is not a valid template type argument for parameter '_Ty1'
C:\Dev\msvc\src\qa\vc\libs\libcxx\upstream\test\std\iterators\stream.iterators\istreambuf.iterator\types.pass.cpp(58): error C2955: 'std::is_same': use of class template requires template argument list
C:\Dev\msvc\binaries\x86ret\inc\xtr1common(84): note: see declaration of 'std::is_same'
C:\Dev\msvc\src\qa\vc\libs\libcxx\upstream\test\std\iterators\stream.iterators\istreambuf.iterator\types.pass.cpp(58): error C2039: 'value': is not a member of 'std::is_same<_Ty1,_Ty2>'
C:\Dev\msvc\src\qa\vc\libs\libcxx\upstream\test\std\iterators\stream.iterators\istreambuf.iterator\types.pass.cpp(58): error C2065: 'value': undeclared identifier
C:\Dev\msvc\src\qa\vc\libs\libcxx\upstream\test\std\iterators\stream.iterators\istreambuf.iterator\types.pass.cpp(59): error C2027: use of undefined type 'std::istreambuf_iterator<wchar_t,std::char_traits<wchar_t>>'
C:\Dev\msvc\src\qa\vc\libs\libcxx\upstream\test\std\iterators\stream.iterators\istreambuf.iterator\types.pass.cpp(51): note: see declaration of 'std::istreambuf_iterator<wchar_t,std::char_traits<wchar_t>>'
C:\Dev\msvc\src\qa\vc\libs\libcxx\upstream\test\std\iterators\stream.iterators\istreambuf.iterator\types.pass.cpp(59): error C2065: 'int_type': undeclared identifier
C:\Dev\msvc\src\qa\vc\libs\libcxx\upstream\test\std\iterators\stream.iterators\istreambuf.iterator\types.pass.cpp(59): fatal error C1003: error count exceeds 100; stopping compilation

### Compile failed with exit code 0x00000002

failure: BION-TR libcxx upstream\test\std\iterators\stream.iterators\istreambuf.iterator types.pass.cpp clang-cl /nologo /Od /W4 /w14061 /w14242 /w14582 /w14583 /w14587 /w14588 /w14265 /w14749 /w14841 /w14842 /w15038 /wd4643 /sdl /WX /Zc:strictStrings /D_ENABLE_STL_INTERNAL_CHECK /bigobj /FImsvc_stdlib_force_include.h /permissive- -fno-ms-compatibility -fno-delayed-template-parsing /EHsc /MTd /std:c++latest
### Compile: "C:\Dev\msvc\src\tools\LLVM\LLVM9\x86\bin\clang-cl.exe" -m32 /FeC:\Dev\msvc\Temp\libcxx\39DFDB291A34DE56D1630B0A720CB135E6F57D42DC525F3AD3371322EE354181\types.pass.exe /FoC:\Dev\msvc\Temp\libcxx\39DFDB291A34DE56D1630B0A720CB135E6F57D42DC525F3AD3371322EE354181\types.pass.obj C:\Dev\msvc\src\qa\vc\libs\libcxx\upstream\test\std\iterators\stream.iterators\istreambuf.iterator\types.pass.cpp /nologo /Od /W4 /w14061 /w14242 /w14582 /w14583 /w14587 /w14588 /w14265 /w14749 /w14841 /w14842 /w15038 /wd4643 /sdl /WX /Zc:strictStrings /D_ENABLE_STL_INTERNAL_CHECK /bigobj /FImsvc_stdlib_force_include.h /permissive- -fno-ms-compatibility -fno-delayed-template-parsing /EHsc /MTd /std:c++latest
### Working directory: C:\Dev\msvc\src\qa\vc\libs\libcxx\upstream\test\std\iterators\stream.iterators\istreambuf.iterator
### Compile took 0:00:00:21.2848595
C:\Dev\msvc\src\qa\vc\libs\libcxx\upstream\test\std\iterators\stream.iterators\istreambuf.iterator\types.pass.cpp(37,33): error: implicit instantiation of undefined template 'std::istreambuf_iterator<char, std::char_traits<char> >'
    static_assert((std::is_same<I1::iterator_category, std::input_iterator_tag>::value), "");
                                ^
C:\Dev\msvc\binaries\x86ret\inc\iosfwd(172,7): note: template is declared here
class istreambuf_iterator;
      ^
C:\Dev\msvc\src\qa\vc\libs\libcxx\upstream\test\std\iterators\stream.iterators\istreambuf.iterator\types.pass.cpp(37,82): error: no type named 'value' in the global namespace
    static_assert((std::is_same<I1::iterator_category, std::input_iterator_tag>::value), "");
                                                                               ~~^
C:\Dev\msvc\src\qa\vc\libs\libcxx\upstream\test\std\iterators\stream.iterators\istreambuf.iterator\types.pass.cpp(38,33): error: implicit instantiation of undefined template 'std::istreambuf_iterator<char, std::char_traits<char> >'
    static_assert((std::is_same<I1::value_type, char>::value), "");
                                ^
C:\Dev\msvc\binaries\x86ret\inc\iosfwd(172,7): note: template is declared here
class istreambuf_iterator;
      ^
C:\Dev\msvc\src\qa\vc\libs\libcxx\upstream\test\std\iterators\stream.iterators\istreambuf.iterator\types.pass.cpp(38,56): error: no type named 'value' in the global namespace
    static_assert((std::is_same<I1::value_type, char>::value), "");
                                                     ~~^
C:\Dev\msvc\src\qa\vc\libs\libcxx\upstream\test\std\iterators\stream.iterators\istreambuf.iterator\types.pass.cpp(39,33): error: implicit instantiation of undefined template 'std::istreambuf_iterator<char, std::char_traits<char> >'
    static_assert((std::is_same<I1::difference_type, std::char_traits<char>::off_type>::value), "");
                                ^
C:\Dev\msvc\binaries\x86ret\inc\iosfwd(172,7): note: template is declared here
class istreambuf_iterator;
      ^
C:\Dev\msvc\src\qa\vc\libs\libcxx\upstream\test\std\iterators\stream.iterators\istreambuf.iterator\types.pass.cpp(39,78): error: no type named 'off_type' in the global namespace
    static_assert((std::is_same<I1::difference_type, std::char_traits<char>::off_type>::value), "");
                                                                           ~~^
C:\Dev\msvc\src\qa\vc\libs\libcxx\upstream\test\std\iterators\stream.iterators\istreambuf.iterator\types.pass.cpp(39,86): error: expected ')'
    static_assert((std::is_same<I1::difference_type, std::char_traits<char>::off_type>::value), "");
                                                                                     ^
C:\Dev\msvc\src\qa\vc\libs\libcxx\upstream\test\std\iterators\stream.iterators\istreambuf.iterator\types.pass.cpp(39,19): note: to match this '('
    static_assert((std::is_same<I1::difference_type, std::char_traits<char>::off_type>::value), "");
                  ^
C:\Dev\msvc\src\qa\vc\libs\libcxx\upstream\test\std\iterators\stream.iterators\istreambuf.iterator\types.pass.cpp(41,33): error: implicit instantiation of undefined template 'std::istreambuf_iterator<char, std::char_traits<char> >'
    static_assert((std::is_same<I1::reference, char>::value), "");
                                ^
C:\Dev\msvc\binaries\x86ret\inc\iosfwd(172,7): note: template is declared here
class istreambuf_iterator;
      ^
C:\Dev\msvc\src\qa\vc\libs\libcxx\upstream\test\std\iterators\stream.iterators\istreambuf.iterator\types.pass.cpp(41,55): error: no type named 'value' in the global namespace
    static_assert((std::is_same<I1::reference, char>::value), "");
                                                    ~~^
C:\Dev\msvc\src\qa\vc\libs\libcxx\upstream\test\std\iterators\stream.iterators\istreambuf.iterator\types.pass.cpp(42,33): error: implicit instantiation of undefined template 'std::istreambuf_iterator<char, std::char_traits<char> >'
    static_assert((std::is_same<I1::char_type, char>::value), "");
                                ^
C:\Dev\msvc\binaries\x86ret\inc\iosfwd(172,7): note: template is declared here
class istreambuf_iterator;
      ^
C:\Dev\msvc\src\qa\vc\libs\libcxx\upstream\test\std\iterators\stream.iterators\istreambuf.iterator\types.pass.cpp(42,55): error: no type named 'value' in the global namespace
    static_assert((std::is_same<I1::char_type, char>::value), "");
                                                    ~~^
C:\Dev\msvc\src\qa\vc\libs\libcxx\upstream\test\std\iterators\stream.iterators\istreambuf.iterator\types.pass.cpp(43,33): error: implicit instantiation of undefined template 'std::istreambuf_iterator<char, std::char_traits<char> >'
    static_assert((std::is_same<I1::traits_type, std::char_traits<char> >::value), "");
                                ^
C:\Dev\msvc\binaries\x86ret\inc\iosfwd(172,7): note: template is declared here
class istreambuf_iterator;
      ^
C:\Dev\msvc\src\qa\vc\libs\libcxx\upstream\test\std\iterators\stream.iterators\istreambuf.iterator\types.pass.cpp(43,73): error: type name requires a specifier or qualifier
    static_assert((std::is_same<I1::traits_type, std::char_traits<char> >::value), "");
                                                                        ^
C:\Dev\msvc\src\qa\vc\libs\libcxx\upstream\test\std\iterators\stream.iterators\istreambuf.iterator\types.pass.cpp(43,73): error: expected ')'
C:\Dev\msvc\src\qa\vc\libs\libcxx\upstream\test\std\iterators\stream.iterators\istreambuf.iterator\types.pass.cpp(43,19): note: to match this '('
    static_assert((std::is_same<I1::traits_type, std::char_traits<char> >::value), "");
                  ^
C:\Dev\msvc\src\qa\vc\libs\libcxx\upstream\test\std\iterators\stream.iterators\istreambuf.iterator\types.pass.cpp(44,33): error: implicit instantiation of undefined template 'std::istreambuf_iterator<char, std::char_traits<char> >'
    static_assert((std::is_same<I1::int_type, I1::traits_type::int_type>::value), "");
                                ^
C:\Dev\msvc\binaries\x86ret\inc\iosfwd(172,7): note: template is declared here
class istreambuf_iterator;
      ^
C:\Dev\msvc\src\qa\vc\libs\libcxx\upstream\test\std\iterators\stream.iterators\istreambuf.iterator\types.pass.cpp(44,75): error: no type named 'value' in the global namespace
    static_assert((std::is_same<I1::int_type, I1::traits_type::int_type>::value), "");
                                                                        ~~^
C:\Dev\msvc\src\qa\vc\libs\libcxx\upstream\test\std\iterators\stream.iterators\istreambuf.iterator\types.pass.cpp(45,33): error: implicit instantiation of undefined template 'std::istreambuf_iterator<char, std::char_traits<char> >'
    static_assert((std::is_same<I1::streambuf_type, std::streambuf>::value), "");
                                ^
C:\Dev\msvc\binaries\x86ret\inc\iosfwd(172,7): note: template is declared here
class istreambuf_iterator;
      ^
C:\Dev\msvc\src\qa\vc\libs\libcxx\upstream\test\std\iterators\stream.iterators\istreambuf.iterator\types.pass.cpp(45,70): error: no type named 'value' in the global namespace
    static_assert((std::is_same<I1::streambuf_type, std::streambuf>::value), "");
                                                                   ~~^
C:\Dev\msvc\src\qa\vc\libs\libcxx\upstream\test\std\iterators\stream.iterators\istreambuf.iterator\types.pass.cpp(46,33): error: implicit instantiation of undefined template 'std::istreambuf_iterator<char, std::char_traits<char> >'
    static_assert((std::is_same<I1::istream_type, std::istream>::value), "");
                                ^
C:\Dev\msvc\binaries\x86ret\inc\iosfwd(172,7): note: template is declared here
class istreambuf_iterator;
      ^
fatal error: too many errors emitted, stopping now [-ferror-limit=]
20 errors generated.

### Compile failed with exit code 0x00000001

Copy link
Member

@BillyONeal BillyONeal left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

At a minimum changes to get istreambuf_iterator defined in <iterator> need to happen first.

@CaseyCarter
Copy link
Member

ostreambuf_iterator will also need to move from <streambuf> to <iterator>, although it seems like less work to extract.

@BillyONeal
Copy link
Member

Yeah, but the streams actually use streambuf_iterator, that's why it's defined there today. I think we would need to introduce a new header that has just *streambuf_iterator, and define the member functions of it in near where they already are (since they need streambuf to be complete).

@StephanTLavavej
Copy link
Member

N4842 [iterator.synopsis] requires <iterator> to provide istreambuf_iterator and ostreambuf_iterator. Currently, this is achieved via:

#include <istream>

#include <ostream>

#include <ios>

#include <xlocnum>

#include <streambuf>

STL/stl/inc/streambuf

Lines 414 to 415 in da0d8cf

template <class _Elem, class _Traits>
class istreambuf_iterator { // wrap stream buffer as input iterator

STL/stl/inc/streambuf

Lines 537 to 538 in da0d8cf

template <class _Elem, class _Traits>
class ostreambuf_iterator { // wrap stream buffer as output iterator

I wonder whether introducing a new internal header is necessary. Could the definitions simply be moved, with appropriate forward declarations (although the two-phase lookup rules might not make this easy/possible)? Splitting up a class definition and its member function definitions is unusual (we virtually never do that).

Copy link
Member

@StephanTLavavej StephanTLavavej left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

istreambuf_iterator and ostreambuf_iterator need to be moved (which may be a nontrivial change).

@Kojoley
Copy link
Contributor Author

Kojoley commented Dec 7, 2019

I can try to sort this out.

Is including <iterator> in xlocmon/xlocnum/xloctime is a no-go? There should be minimal overhead since the xutility header it includes is pulled in <streambuf> via xutility <- xmemory <- xstring <- stdexcept <- system_error <- xiosbase <- streambuf chain (streambuf <- xlocnum, xlocnum <- xlocmon, xlocnum <- xloctime). Otherwise moving [io]streambuf_iterator to a separate header is the only solution.

@StephanTLavavej
Copy link
Member

Is including <iterator> in xlocmon/xlocnum/xloctime is a no-go?

Go for it - I agree that the additional cost should be very small, and those headers are already heavyweight.

@BillyONeal BillyONeal removed their assignment Dec 7, 2019
@BillyONeal
Copy link
Member

Yeah, this header is small enough that there's no need to create something else if making it work can be done without introduction of circular dependencies.

It might even make sense to delete <xutility> and move its contents into <iterator> to save a disk access in most cases, since most of our iterator support machinery is actually in <xutility>. OTOH that would make it harder to suck the couple of algorithms in there out if we ever wanted to do that in the future.

@BillyONeal
Copy link
Member

Ah, I take back my <xutility> comment, I think that might create circular reference issue with <iosfwd>...

@StephanTLavavej
Copy link
Member

And <xutility> provides the begin(), size(), etc. overloads that all containers must provide, but <vector> shouldn’t drag in the iterator adaptors, much less the stream iterators.

@msftclas
Copy link

msftclas commented Dec 7, 2019

CLA assistant check
All CLA requirements met.

@Kojoley Kojoley changed the title iterator: replace <istream> with <iosfwd> <iterator>: reduced parsing time Dec 7, 2019
@Kojoley
Copy link
Contributor Author

Kojoley commented Dec 7, 2019

Updated the PR. Stats are in the first post. Also verified with libc++ std/iterators/std/input.output test this time.

* Replaced `<istream>` include with `<iosfwd>` because `[io]stream_iterator`
  needs only `basic_[io]stream` forward declaration.
* Moved `[io]streambuf_iterator` iterator definition to `<iterator>` because
  their definition has to come when `<iterator>` is included.
* Include `<iterator>` in `<xlocmon>`, `<xlocnum>`, and `<xloctime>` as
  the `[io]streambuf_iterator` definition are required there, and `<xutility>`
  already included via other includes.

Parsing times:

| header     |          clang          |           msvc          |
|------------|-------------------------|-------------------------|
| <iterator> | 0.371 -> 0.163 (-56.1%) | 0.216 -> 0.094 (-56.5%) |
| <istream>  | 0.366 -> 0.372 ( +1.6%) | 0.215 -> 0.216 ( +0.5%) |
| <xlocmon>  | 0.358 -> 0.364 ( +1.7%) | 0.211 -> 0.211 (    0%) |
| <xlocnum>  | 0.357 -> 0.360 ( +0.8%) | 0.207 -> 0.208 ( +0.5%) |
| <xloctime> | 0.364 -> 0.370 ( +1.6%) | 0.211 -> 0.214 ( +1.4%) |
@@ -8,6 +8,7 @@
#define _XLOCMON_
#include <yvals_core.h>
#if _STL_COMPILER_PREPROCESSOR
#include <iterator>
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Including <iterator> is unnecessary in <xlocmon> and <xloctime>, and it's slightly inconsistent with the existing code that appears to treat <xlocnum> as central. However, I'm fine with this change. (STL headers are wildly inconsistent about assuming transitive inclusion, although we try to be very clean in our tests.)

@StephanTLavavej StephanTLavavej self-assigned this Dec 10, 2019
@StephanTLavavej
Copy link
Member

There's at least one file within the compiler's sources that was using wostream and its operator<< without including <ostream>, leading to compiler errors of the form:

error C2676: binary '<<': 'std::wostream' does not define this operator or a conversion to a type acceptable to the predefined operator
error C2027: use of undefined type 'std::basic_ostream<wchar_t,std::char_traits<wchar_t>>'

I'm fixing them up, but I believe that we should merge this change right after VS 2019 16.5 Preview 2 branches for release (so we have all of the 16.6 cycle to deal with the fallout in Real World Code).

@BillyONeal
Copy link
Member

There's at least one file within the compiler's sources that was using wostream and its operator<< without including <ostream>, leading to compiler errors of the form:

error C2676: binary '<<': 'std::wostream' does not define this operator or a conversion to a type acceptable to the predefined operator
error C2027: use of undefined type 'std::basic_ostream<wchar_t,std::char_traits<wchar_t>>'

I'm fixing them up, but I believe that we should merge this change right after VS 2019 16.5 Preview 2 branches for release (so we have all of the 16.6 cycle to deal with the fallout in Real World Code).

Derp, sorry for sending you on that goose chase. I had already prepared the same fix :P https://devdiv.visualstudio.com/DefaultCollection/DevDiv/_git/msvc/commit/c72ac3991d63213948afe51926c1c6bb2dd74003?refName=refs%2Fheads%2Fdev%2Fbion%2Fgh-355

Copy link
Member

@BillyONeal BillyONeal left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

As long as @StephanTLavavej indicates that this passed testing, LGTM

@StephanTLavavej
Copy link
Member

Two more failure categories in libcxx's test suite:

  • upstream\test\std\containers\sequences\array\at.pass.cpp needs to include <stdexcept> for out_of_range.
  • 9 files in upstream\test\std\localization\locale.categories\category.time such as locale.time.get.byname\get_time.pass.cpp need to include <ios> for basic_ios.

@StephanTLavavej
Copy link
Member

I've gotten this to pass our internal testing. I'm planning to wait until after Friday (2019-12-13) to merge this, so that the source breaking changes will appear in VS 2019 16.6. (This is partially because making source breaking changes at the beginning of a release cycle is better than at the end, and partially because 16.5 will be the first release with STL GitHub changes, and it would be nice for it to be minimally disruptive.)

Copy link
Member

@CaseyCarter CaseyCarter left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I haven't approved for a while, so here's another approval.

@StephanTLavavej
Copy link
Member

Fixed libcxx tests upstream: llvm/llvm-project@5688f16

Created Microsoft-internal MSVC-PR-218964.

@StephanTLavavej StephanTLavavej merged commit e59afea into microsoft:master Dec 17, 2019
@StephanTLavavej
Copy link
Member

I've merged this for VS 2019 16.6. We'll see in the next few days how many open-source projects in our "Real World Code" test suite this breaks; we'll submit PRs to those projects if the number of breaks is fairly low, but we may need to consider reverting this throughput improvement if the source breaking impact is enormous.

Thanks for the improvement, and congratulations on your first microsoft/STL commit!

@Kojoley
Copy link
Contributor Author

Kojoley commented Dec 17, 2019

Thanks for merging!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants