https://gcc.gnu.org/bugzilla/show_bug.cgi?id=78861

            Bug ID: 78861
           Summary: sequencer.cpp:603:53: error: cannot convert
                    'std::basic_istream<char>::__istream_type {aka
                    std::basic_istream<char>}' to 'bool' in assignment
           Product: gcc
           Version: 6.2.1
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c++
          Assignee: unassigned at gcc dot gnu.org
          Reporter: martin.gansser at gmail dot com
  Target Milestone: ---

Hi,

i tried to compile a programm with gcc (GCC) 6.2.1 20160916 (Red Hat 6.2.1-2),
but this fails with this error message:

cd
/home/martin/rpmbuild/BUILD/plee-the-bear-0.7.0-light/plee-the-bear/lib/src/ptb
&& /usr/bin/c++   -DNDEBUG -DPTB_TEXT_DOMAIN_PATH=/usr/share/locale
-Dplee_the_bear_EXPORTS -I/usr/include/SDL
-I/usr/include/bear/bear-engine/core/src
-I/usr/include/bear/bear-engine/lib/src
-I/home/martin/rpmbuild/BUILD/plee-the-bear-0.7.0-light/plee-the-bear/lib/src/ptb/..
 -O2 -g -pipe -Wall -Werror=format-security -Wp,-D_FORTIFY_SOURCE=2
-fexceptions -fstack-protector-strong --param=ssp-buffer-size=4
-grecord-gcc-switches -specs=/usr/lib/rpm/redhat/redhat-hardened-cc1 -m64
-mtune=generic  -DNDEBUG -fPIC   -Wall -std=c++11 -pedantic
-Wmissing-field-initializers -Wuninitialized -o
CMakeFiles/plee_the_bear.dir/item/mini-game/code/sequencer_control.cpp.o -c
/home/martin/rpmbuild/BUILD/plee-the-bear-0.7.0-light/plee-the-bear/lib/src/ptb/item/mini-game/code/sequencer_control.cpp
/home/martin/rpmbuild/BUILD/plee-the-bear-0.7.0-light/plee-the-bear/lib/src/ptb/item/mini-game/code/sequencer.cpp:
In member function 'bool ptb::sequencer::load_track_file(const string&)':
/home/martin/rpmbuild/BUILD/plee-the-bear-0.7.0-light/plee-the-bear/lib/src/ptb/item/mini-game/code/sequencer.cpp:603:53:
error: cannot convert 'std::basic_istream<char>::__istream_type {aka
std::basic_istream<char>}' to 'bool' in assignment
             result = ( iss >> t.duration >> t.width );


In the relevant source file:

bool ptb::sequencer::load_track_file( const std::string& file_name )
{
  std::stringstream f;
  bear::engine::resource_pool::get_instance().get_file(file_name, f);
  std::string line;
  track t;
  bool result(false);
  bear::universe::time_type prev_date(0);
  std::size_t n(0);

  while ( !result && std::getline(f, line) )
    {
      claw::text::trim(line);

      if ( !line.empty() )
        if ( line[0] != '#' )
          {
            std::istringstream iss(line);
            result = ( iss >> t.duration >> t.width );
          }

      ++n;
    }

Reply via email to