Bug 216034 - textproc/libxml++26: fails to build with lang/gcc6 or later
Summary: textproc/libxml++26: fails to build with lang/gcc6 or later
Status: Closed FIXED
Alias: None
Product: Ports & Packages
Classification: Unclassified
Component: Individual Port(s) (show other bugs)
Version: Latest
Hardware: Any Any
: --- Affects Only Me
Assignee: Jan Beich
URL:
Keywords: needs-patch
Depends on:
Blocks:
 
Reported: 2017-01-13 16:10 UTC by Jan Beich
Modified: 2017-05-14 14:17 UTC (History)
3 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Jan Beich freebsd_committer freebsd_triage 2017-01-13 16:10:18 UTC
libxml++/io/istreamparserinputbuffer.cc:42:12: error: no viable conversion from returned value of
      type 'std::istream' (aka 'basic_istream<char>') to function return type 'bool'
    return input_;
           ^~~~~~
libxml++/io/ostreamoutputbuffer.cc:32:12: error: no viable conversion from returned value of type
      'std::ostream' (aka 'basic_ostream<char>') to function return type 'bool'
    return output_;
           ^~~~~~~
libxml++/io/ostreamoutputbuffer.cc:39:12: error: no viable conversion from returned value of type
      'std::ostream' (aka 'basic_ostream<char>') to function return type 'bool'
    return output_;
           ^~~~~~~

build log: http://sprunge.us/cbjD
bisect first bad: https://github.com/llvm-mirror/libcxx/commit/3a1b90a866b6
Comment 1 Dimitry Andric freebsd_committer freebsd_triage 2017-01-13 17:54:59 UTC
It seems the correct workaround is to explicitly convert the istreams/ostreams to bool, e.g. something like:

   return bool(input_);
Comment 2 Dimitry Andric freebsd_committer freebsd_triage 2017-01-13 17:59:42 UTC
Btw, does this port build its C++ sources with -std=c++11?
Comment 3 Jan Beich freebsd_committer freebsd_triage 2017-01-13 18:08:56 UTC
(In reply to Dimitry Andric from comment #1)
>   return bool(input_);

Thanks. It builds fine with such a change.

(In reply to Dimitry Andric from comment #2)
> does this port build its C++ sources with -std=c++11?

No. And -std=c++11 alone doesn't fix the issue here. With bool(input_) fix it builds fine with -std=c++11 as well.
Comment 4 commit-hook freebsd_committer freebsd_triage 2017-01-13 18:24:32 UTC
A commit references this bug:

Author: jbeich
Date: Fri Jan 13 18:23:39 UTC 2017
New revision: 431411
URL: https://svnweb.freebsd.org/changeset/ports/431411

Log:
  textproc/libxml++26: unbreak build with libc++ 4.0

  libxml++/io/istreamparserinputbuffer.cc:42:12: error: no viable conversion from returned value of
        type 'std::istream' (aka 'basic_istream<char>') to function return type 'bool'
      return input_;
             ^~~~~~
  libxml++/io/ostreamoutputbuffer.cc:32:12: error: no viable conversion from returned value of type
        'std::ostream' (aka 'basic_ostream<char>') to function return type 'bool'
      return output_;
             ^~~~~~~
  libxml++/io/ostreamoutputbuffer.cc:39:12: error: no viable conversion from returned value of type
        'std::ostream' (aka 'basic_ostream<char>') to function return type 'bool'
      return output_;
             ^~~~~~~

  PR:		216034
  Regressed by:	https://github.com/llvm-mirror/libcxx/commit/3a1b90a866b6
  Submitted by:	dim
  Approved by:	portmgr blanket

Changes:
  head/textproc/libxml++26/files/
  head/textproc/libxml++26/files/patch-libxml++_io_istreamparserinputbuffer.cc
  head/textproc/libxml++26/files/patch-libxml++_io_ostreamoutputbuffer.cc
Comment 5 commit-hook freebsd_committer freebsd_triage 2017-01-13 18:41:47 UTC
A commit references this bug:

Author: jbeich
Date: Fri Jan 13 18:40:50 UTC 2017
New revision: 431412
URL: https://svnweb.freebsd.org/changeset/ports/431412

Log:
  textproc/libxml++26: replace r431411 with upstream fix

  PR:		216034

Changes:
  head/textproc/libxml++26/Makefile
  head/textproc/libxml++26/files/patch-c++11
  head/textproc/libxml++26/files/patch-libxml++_io_istreamparserinputbuffer.cc
  head/textproc/libxml++26/files/patch-libxml++_io_ostreamoutputbuffer.cc
Comment 6 Dimitry Andric freebsd_committer freebsd_triage 2017-01-13 22:17:18 UTC
Note that the upstream author has reverted the commit causing this here:

http://llvm.org/viewvc/llvm-project?rev=291921&view=rev

and has also merged it to the 4.0 branch.  I will import the upstream branch into the projects/clang400-import branch soon.
Comment 7 Jan Beich freebsd_committer freebsd_triage 2017-01-13 22:30:47 UTC
libstdc++ from lang/gcc6 fails similar to comment 0, so I'm not going to back the fix out. However, DragonFly folks are still on GCC 5.x which is unaffected.

libxml++/io/istreamparserinputbuffer.cc: In member function 'virtual bool xmlpp::IStreamParserInputBuffer::do_close()':
libxml++/io/istreamparserinputbuffer.cc:42:12: error: cannot convert 'std::istream {aka std::basic_istream<char>}' to 'bool' in return
     return input_;
            ^~~~~~
libxml++/io/ostreamoutputbuffer.cc: In member function 'virtual bool xmlpp::OStreamOutputBuffer::do_write(const char*, int)':
libxml++/io/ostreamoutputbuffer.cc:32:12: error: cannot convert 'std::ostream {aka std::basic_ostream<char>}' to 'bool' in return
     return output_;
            ^~~~~~~
libxml++/io/ostreamoutputbuffer.cc: In member function 'virtual bool xmlpp::OStreamOutputBuffer::do_close()':
libxml++/io/ostreamoutputbuffer.cc:39:12: error: cannot convert 'std::ostream {aka std::basic_ostream<char>}' to 'bool' in return
     return output_;
            ^~~~~~~