Uploaded image for project: 'C++ Standard Library'
  1. C++ Standard Library
  2. STDCXX-321

error on std::operator==(istream_iterator, istream_iterator)

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Fixed
    • 4.1.2, 4.1.3, 4.1.4, 4.2.0
    • 4.2.1
    • 24. Iterators
    • None
    • All

    • Compiler Error

    Description

      The well-formed program below fails to compile with both EDG eccp 3.8 and gcc 4.1.0 (I didn't try others but it's likely a bug in the library)

      $ cat t.cpp && make t
      #include <iterator>
      
      int main ()
      {
          std::istream_iterator<char, char> i;
          (void)(i == i);
      }
      
      eccp -c -I/build/sebor/dev/stdlib/include/ansi -D_RWSTDDEBUG    -D_RWSTD_USE_CONFIG -I/build/sebor/dev/stdlib/include -I/build/sebor/eccp-3.8-11s/include -I/build/sebor/dev/stdlib/include/ansi -I/build/sebor/PlumHall/lvs06a/conform -I/build/sebor/PlumHall/lvs06a/dst.3  -A -x --template_directory=/build/sebor/eccp-3.8-11s/lib -g  --display_error_number --remarks --diag_suppress 193,236,340,401,261,479,487,678,679,815 --diag_suppress 177,381,191,68,550,611,997,549   t.cpp
      "/build/sebor/dev/stdlib/include/rw/_streamiter.h", line 124: error #349: no
                operator "!" matches these operands
                  operand types are: ! std::basic_istream<char,
                            std::char_traits<char>>
            return (__x._C_strm && !!*__x._C_strm) == (__y._C_strm && !!*__y._C_strm);
                                    ^
                detected during instantiation of "bool std::operator==(const
                          std::istream_iterator<_TypeT, _CharT, _Traits, _Distance>
                          &, const std::istream_iterator<_TypeT, _CharT, _Traits,
                          _Distance> &) [with _TypeT=char, _CharT=char,
                          _Traits=std::char_traits<char>, _Distance=int]" at line 6
                          of "t.cpp"
      
      "/build/sebor/dev/stdlib/include/rw/_streamiter.h", line 124: error #349: no
                operator "!" matches these operands
                  operand types are: ! std::basic_istream<char,
                            std::char_traits<char>>
            return (__x._C_strm && !!*__x._C_strm) == (__y._C_strm && !!*__y._C_strm);
                                                                       ^
                detected during instantiation of "bool std::operator==(const
                          std::istream_iterator<_TypeT, _CharT, _Traits, _Distance>
                          &, const std::istream_iterator<_TypeT, _CharT, _Traits,
                          _Distance> &) [with _TypeT=char, _CharT=char,
                          _Traits=std::char_traits<char>, _Distance=int]" at line 6
                          of "t.cpp"
      
      2 errors detected in the compilation of "t.cpp".
      make: *** [t.o] Error 2
      

      Attachments

        Issue Links

          Activity

            People

              sebor Martin Sebor
              sebor Martin Sebor
              Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Time Tracking

                  Estimated:
                  Original Estimate - 4h
                  4h
                  Remaining:
                  Time Spent - 3.5h Remaining Estimate - 0.5h
                  0.5h
                  Logged:
                  Time Spent - 3.5h Remaining Estimate - 0.5h
                  3.5h