Bug 216055

Summary: textproc/irstlm: fails to build with lang/gcc6 or later
Product: Ports & Packages Reporter: Jan Beich <jbeich>
Component: Individual Port(s)Assignee: Jan Beich <jbeich>
Status: Closed FIXED    
Severity: Affects Only Me Keywords: needs-patch
Priority: --- Flags: demon: maintainer-feedback+
Version: Latest   
Hardware: Any   
OS: Any   
See Also: https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=216034
https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=216035
https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=216047
https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=216053
https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=216036
https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=216060
https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=216066
https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=216070
https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=216077
https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=216078
https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=216080
https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=216082

Description Jan Beich freebsd_committer freebsd_triage 2017-01-14 06:07:43 UTC
util.cpp:80:18: error: invalid operands to binary expression ('mfstream' and 'int')
  if (fileStream == 0)
      ~~~~~~~~~~ ^  ~

build log: http://sprunge.us/AhFi
regressed by: https://github.com/llvm-mirror/libcxx/commit/3a1b90a866b6
Comment 1 Jan Beich freebsd_committer freebsd_triage 2017-01-14 06:10:00 UTC
(In reply to Dimitry Andric from bug 216034 comment #6)
> 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.

lang/gcc6 and later versions are also affected and tell a slightly more verbose story:

util.cpp: In function 'void createtempfile(mfstream&, std::__cxx11::string&, std::ios_base::openmode)':
util.cpp:80:18: error: no match for 'operator==' (operand types are 'mfstream' and 'int')
   if (fileStream == 0)
       ~~~~~~~~~~~^~~~
util.cpp:80:18: note: candidate: operator==(int, int) <built-in>
util.cpp:80:18: note:   no known conversion for argument 1 from 'mfstream' to 'int'
In file included from /usr/local/lib/gcc6/include/c++/iosfwd:40:0,
                 from /usr/local/lib/gcc6/include/c++/ios:38,
                 from /usr/local/lib/gcc6/include/c++/ostream:38,
                 from /usr/local/lib/gcc6/include/c++/iostream:39,
                 from util.cpp:29:
/usr/local/lib/gcc6/include/c++/bits/postypes.h:216:5: note: candidate: template<class _StateT> boolstd::operator==(const std::fpos<_StateT>&, const std::fpos<_StateT>&)
     operator==(const fpos<_StateT>& __lhs, const fpos<_StateT>& __rhs)
     ^~~~~~~~
/usr/local/lib/gcc6/include/c++/bits/postypes.h:216:5: note:   template argument deduction/substitution failed:
util.cpp:80:21: note:   'mfstream' is not derived from 'const std::fpos<_StateT>'
   if (fileStream == 0)
                     ^
In file included from /usr/local/lib/gcc6/include/c++/bits/stl_algobase.h:64:0,
                 from /usr/local/lib/gcc6/include/c++/bits/char_traits.h:39,
                 from /usr/local/lib/gcc6/include/c++/ios:40,
                 from /usr/local/lib/gcc6/include/c++/ostream:38,
                 from /usr/local/lib/gcc6/include/c++/iostream:39,
                 from util.cpp:29:
/usr/local/lib/gcc6/include/c++/bits/stl_pair.h:431:5: note: candidate: template<class _T1, class _T2> constexpr bool std::operator==(const std::pair<_T1, _T2>&, const std::pair<_T1, _T2>&)
     operator==(const pair<_T1, _T2>& __x, const pair<_T1, _T2>& __y)
     ^~~~~~~~
/usr/local/lib/gcc6/include/c++/bits/stl_pair.h:431:5: note:   template argument deduction/substitution failed:
util.cpp:80:21: note:   'mfstream' is not derived from 'const std::pair<_T1, _T2>'
   if (fileStream == 0)
                     ^
In file included from /usr/local/lib/gcc6/include/c++/bits/stl_algobase.h:67:0,
                 from /usr/local/lib/gcc6/include/c++/bits/char_traits.h:39,
                 from /usr/local/lib/gcc6/include/c++/ios:40,
                 from /usr/local/lib/gcc6/include/c++/ostream:38,
                 from /usr/local/lib/gcc6/include/c++/iostream:39,
                 from util.cpp:29:
/usr/local/lib/gcc6/include/c++/bits/stl_iterator.h:292:5: note: candidate: template<class _Iterator> bool std::operator==(const std::reverse_iterator<_Iterator>&, const std::reverse_iterator<_Iterator>&)
     operator==(const reverse_iterator<_Iterator>& __x,
     ^~~~~~~~
/usr/local/lib/gcc6/include/c++/bits/stl_iterator.h:292:5: note:   template argument deduction/substitution failed:
util.cpp:80:21: note:   'mfstream' is not derived from 'const std::reverse_iterator<_Iterator>'
   if (fileStream == 0)
                     ^
In file included from /usr/local/lib/gcc6/include/c++/bits/stl_algobase.h:67:0,
                 from /usr/local/lib/gcc6/include/c++/bits/char_traits.h:39,
                 from /usr/local/lib/gcc6/include/c++/ios:40,
                 from /usr/local/lib/gcc6/include/c++/ostream:38,
                 from /usr/local/lib/gcc6/include/c++/iostream:39,
                 from util.cpp:29:
/usr/local/lib/gcc6/include/c++/bits/stl_iterator.h:349:5: note: candidate: template<class _IteratorL, class _IteratorR> bool std::operator==(const std::reverse_iterator<_Iterator>&, const std::reverse_iterator<_IteratorR>&)
     operator==(const reverse_iterator<_IteratorL>& __x,
     ^~~~~~~~
/usr/local/lib/gcc6/include/c++/bits/stl_iterator.h:349:5: note:   template argument deduction/substitution failed:
util.cpp:80:21: note:   'mfstream' is not derived from 'const std::reverse_iterator<_Iterator>'
   if (fileStream == 0)
                     ^
In file included from /usr/local/lib/gcc6/include/c++/bits/stl_algobase.h:67:0,
                 from /usr/local/lib/gcc6/include/c++/bits/char_traits.h:39,
                 from /usr/local/lib/gcc6/include/c++/ios:40,
                 from /usr/local/lib/gcc6/include/c++/ostream:38,
                 from /usr/local/lib/gcc6/include/c++/iostream:39,
                 from util.cpp:29:
/usr/local/lib/gcc6/include/c++/bits/stl_iterator.h:1113:5: note: candidate: template<class _IteratorL, class _IteratorR> bool std::operator==(const std::move_iterator<_IteratorL>&, const std::move_iterator<_IteratorR>&)
     operator==(const move_iterator<_IteratorL>& __x,
     ^~~~~~~~
/usr/local/lib/gcc6/include/c++/bits/stl_iterator.h:1113:5: note:   template argument deduction/substitution failed:
util.cpp:80:21: note:   'mfstream' is not derived from 'const std::move_iterator<_IteratorL>'
   if (fileStream == 0)
                     ^
In file included from /usr/local/lib/gcc6/include/c++/bits/stl_algobase.h:67:0,
                 from /usr/local/lib/gcc6/include/c++/bits/char_traits.h:39,
                 from /usr/local/lib/gcc6/include/c++/ios:40,
                 from /usr/local/lib/gcc6/include/c++/ostream:38,
                 from /usr/local/lib/gcc6/include/c++/iostream:39,
                 from util.cpp:29:
/usr/local/lib/gcc6/include/c++/bits/stl_iterator.h:1119:5: note: candidate: template<class _Iterator> bool std::operator==(const std::move_iterator<_IteratorL>&, const std::move_iterator<_IteratorL>&)
     operator==(const move_iterator<_Iterator>& __x,
     ^~~~~~~~
/usr/local/lib/gcc6/include/c++/bits/stl_iterator.h:1119:5: note:   template argument deduction/substitution failed:
util.cpp:80:21: note:   'mfstream' is not derived from 'const std::move_iterator<_IteratorL>'
   if (fileStream == 0)
                     ^
In file included from /usr/local/lib/gcc6/include/c++/string:41:0,
                 from /usr/local/lib/gcc6/include/c++/bits/locale_classes.h:40,
                 from /usr/local/lib/gcc6/include/c++/bits/ios_base.h:41,
                 from /usr/local/lib/gcc6/include/c++/ios:42,
                 from /usr/local/lib/gcc6/include/c++/ostream:38,
                 from /usr/local/lib/gcc6/include/c++/iostream:39,
                 from util.cpp:29:
/usr/local/lib/gcc6/include/c++/bits/allocator.h:146:5: note: candidate: template<class _T1, class _T2> bool std::operator==(const std::allocator<_CharT>&, const std::allocator<_T2>&)
     operator==(const allocator<_T1>&, const allocator<_T2>&)
     ^~~~~~~~
/usr/local/lib/gcc6/include/c++/bits/allocator.h:146:5: note:   template argument deduction/substitution failed:
util.cpp:80:21: note:   'mfstream' is not derived from 'const std::allocator<_CharT>'
   if (fileStream == 0)
                     ^
In file included from /usr/local/lib/gcc6/include/c++/string:41:0,
                 from /usr/local/lib/gcc6/include/c++/bits/locale_classes.h:40,
                 from /usr/local/lib/gcc6/include/c++/bits/ios_base.h:41,
                 from /usr/local/lib/gcc6/include/c++/ios:42,
                 from /usr/local/lib/gcc6/include/c++/ostream:38,
                 from /usr/local/lib/gcc6/include/c++/iostream:39,
                 from util.cpp:29:
/usr/local/lib/gcc6/include/c++/bits/allocator.h:152:5: note: candidate: template<class _Tp> bool std::operator==(const std::allocator<_CharT>&, const std::allocator<_CharT>&)
     operator==(const allocator<_Tp>&, const allocator<_Tp>&)
     ^~~~~~~~
/usr/local/lib/gcc6/include/c++/bits/allocator.h:152:5: note:   template argument deduction/substitution failed:
util.cpp:80:21: note:   'mfstream' is not derived from 'const std::allocator<_CharT>'
   if (fileStream == 0)
                     ^
In file included from /usr/local/lib/gcc6/include/c++/string:52:0,
                 from /usr/local/lib/gcc6/include/c++/bits/locale_classes.h:40,
                 from /usr/local/lib/gcc6/include/c++/bits/ios_base.h:41,
                 from /usr/local/lib/gcc6/include/c++/ios:42,
                 from /usr/local/lib/gcc6/include/c++/ostream:38,
                 from /usr/local/lib/gcc6/include/c++/iostream:39,
                 from util.cpp:29:
/usr/local/lib/gcc6/include/c++/bits/basic_string.h:5050:5: note: candidate: template<class _CharT, class _Traits, class _Alloc> bool std::operator==(const std::__cxx11::basic_string<_CharT, _Traits, _Alloc>&, const std::__cxx11::basic_string<_CharT, _Traits, _Alloc>&)
     operator==(const basic_string<_CharT, _Traits, _Alloc>& __lhs,
     ^~~~~~~~
/usr/local/lib/gcc6/include/c++/bits/basic_string.h:5050:5: note:   template argument deduction/substitution failed:
util.cpp:80:21: note:   'mfstream' is not derived from 'const std::__cxx11::basic_string<_CharT, _Traits, _Alloc>'
   if (fileStream == 0)
                     ^
In file included from /usr/local/lib/gcc6/include/c++/string:52:0,
                 from /usr/local/lib/gcc6/include/c++/bits/locale_classes.h:40,
                 from /usr/local/lib/gcc6/include/c++/bits/ios_base.h:41,
                 from /usr/local/lib/gcc6/include/c++/ios:42,
                 from /usr/local/lib/gcc6/include/c++/ostream:38,
                 from /usr/local/lib/gcc6/include/c++/iostream:39,
                 from util.cpp:29:
/usr/local/lib/gcc6/include/c++/bits/basic_string.h:5058:5: note: candidate: template<class _CharT> typename __gnu_cxx::__enable_if<std::__is_char<_Tp>::__value, bool>::__type std::operator==(const std::__cxx11::basic_string<_CharT>&, const std::__cxx11::basic_string<_CharT>&)
     operator==(const basic_string<_CharT>& __lhs,
     ^~~~~~~~
/usr/local/lib/gcc6/include/c++/bits/basic_string.h:5058:5: note:   template argument deduction/substitution failed:
util.cpp:80:21: note:   'mfstream' is not derived from 'const std::__cxx11::basic_string<_CharT>'
   if (fileStream == 0)
                     ^
In file included from /usr/local/lib/gcc6/include/c++/string:52:0,
                 from /usr/local/lib/gcc6/include/c++/bits/locale_classes.h:40,
                 from /usr/local/lib/gcc6/include/c++/bits/ios_base.h:41,
                 from /usr/local/lib/gcc6/include/c++/ios:42,
                 from /usr/local/lib/gcc6/include/c++/ostream:38,
                 from /usr/local/lib/gcc6/include/c++/iostream:39,
                 from util.cpp:29:
/usr/local/lib/gcc6/include/c++/bits/basic_string.h:5072:5: note: candidate: template<class _CharT, class _Traits, class _Alloc> bool std::operator==(const _CharT*, const std::__cxx11::basic_string<_CharT, _Traits, _Alloc>&)
     operator==(const _CharT* __lhs,
     ^~~~~~~~
/usr/local/lib/gcc6/include/c++/bits/basic_string.h:5072:5: note:   template argument deduction/substitution failed:
util.cpp:80:21: note:   mismatched types 'const _CharT*' and 'mfstream'
   if (fileStream == 0)
                     ^
In file included from /usr/local/lib/gcc6/include/c++/string:52:0,
                 from /usr/local/lib/gcc6/include/c++/bits/locale_classes.h:40,
                 from /usr/local/lib/gcc6/include/c++/bits/ios_base.h:41,
                 from /usr/local/lib/gcc6/include/c++/ios:42,
                 from /usr/local/lib/gcc6/include/c++/ostream:38,
                 from /usr/local/lib/gcc6/include/c++/iostream:39,
                 from util.cpp:29:
/usr/local/lib/gcc6/include/c++/bits/basic_string.h:5084:5: note: candidate: template<class _CharT, class _Traits, class _Alloc> bool std::operator==(const std::__cxx11::basic_string<_CharT, _Traits, _Alloc>&, const _CharT*)
     operator==(const basic_string<_CharT, _Traits, _Alloc>& __lhs,
     ^~~~~~~~
/usr/local/lib/gcc6/include/c++/bits/basic_string.h:5084:5: note:   template argument deduction/substitution failed:
util.cpp:80:21: note:   'mfstream' is not derived from 'const std::__cxx11::basic_string<_CharT, _Traits, _Alloc>'
   if (fileStream == 0)
                     ^
In file included from /usr/local/lib/gcc6/include/c++/bits/ios_base.h:46:0,
                 from /usr/local/lib/gcc6/include/c++/ios:42,
                 from /usr/local/lib/gcc6/include/c++/ostream:38,
                 from /usr/local/lib/gcc6/include/c++/iostream:39,
                 from util.cpp:29:
/usr/local/lib/gcc6/include/c++/system_error:284:3: note: candidate: bool std::operator==(const std::error_code&, const std::error_code&)
   operator==(const error_code& __lhs, const error_code& __rhs) noexcept
   ^~~~~~~~
/usr/local/lib/gcc6/include/c++/system_error:284:3: note:   no known conversion for argument 1 from 'mfstream' to 'const std::error_code&'
/usr/local/lib/gcc6/include/c++/system_error:289:3: note: candidate: bool std::operator==(const std::error_code&, const std::error_condition&)
   operator==(const error_code& __lhs, const error_condition& __rhs) noexcept
   ^~~~~~~~
/usr/local/lib/gcc6/include/c++/system_error:289:3: note:   no known conversion for argument 1 from 'mfstream' to 'const std::error_code&'
/usr/local/lib/gcc6/include/c++/system_error:296:3: note: candidate: bool std::operator==(const std::error_condition&, const std::error_code&)
   operator==(const error_condition& __lhs, const error_code& __rhs) noexcept
   ^~~~~~~~
/usr/local/lib/gcc6/include/c++/system_error:296:3: note:   no known conversion for argument 1 from 'mfstream' to 'const std::error_condition&'
/usr/local/lib/gcc6/include/c++/system_error:303:3: note: candidate: bool std::operator==(const std::error_condition&, const std::error_condition&)
   operator==(const error_condition& __lhs,
   ^~~~~~~~
/usr/local/lib/gcc6/include/c++/system_error:303:3: note:   no known conversion for argument 1 from 'mfstream' to 'const std::error_condition&'
In file included from /usr/local/lib/gcc6/include/c++/bits/locale_facets.h:48:0,
                 from /usr/local/lib/gcc6/include/c++/bits/basic_ios.h:37,
                 from /usr/local/lib/gcc6/include/c++/ios:44,
                 from /usr/local/lib/gcc6/include/c++/ostream:38,
                 from /usr/local/lib/gcc6/include/c++/iostream:39,
                 from util.cpp:29:
/usr/local/lib/gcc6/include/c++/bits/streambuf_iterator.h:204:5: note: candidate: template<class _CharT, class _Traits> bool std::operator==(const std::istreambuf_iterator<_CharT, _Traits>&, const std::istreambuf_iterator<_CharT, _Traits>&)
     operator==(const istreambuf_iterator<_CharT, _Traits>& __a,
     ^~~~~~~~
/usr/local/lib/gcc6/include/c++/bits/streambuf_iterator.h:204:5: note:   template argument deduction/substitution failed:
util.cpp:80:21: note:   'mfstream' is not derived from 'const std::istreambuf_iterator<_CharT, _Traits>'
   if (fileStream == 0)
                     ^
In file included from /usr/local/lib/gcc6/include/c++/tuple:39:0,
                 from /usr/local/lib/gcc6/include/c++/bits/unique_ptr.h:37,
                 from /usr/local/lib/gcc6/include/c++/bits/locale_conv.h:41,
                 from /usr/local/lib/gcc6/include/c++/locale:43,
                 from /usr/local/lib/gcc6/include/c++/iomanip:43,
                 from timer.h:6,
                 from util.cpp:34:
/usr/local/lib/gcc6/include/c++/array:241:5: note: candidate: template<class _Tp, long unsigned int _Nm> bool std::operator==(const std::array<_Tp, _Nm>&, const std::array<_Tp, _Nm>&)
     operator==(const array<_Tp, _Nm>& __one, const array<_Tp, _Nm>& __two)
     ^~~~~~~~
/usr/local/lib/gcc6/include/c++/array:241:5: note:   template argument deduction/substitution failed:
util.cpp:80:21: note:   'mfstream' is not derived from 'const std::array<_Tp, _Nm>'
   if (fileStream == 0)
                     ^
In file included from /usr/local/lib/gcc6/include/c++/bits/unique_ptr.h:37:0,
                 from /usr/local/lib/gcc6/include/c++/bits/locale_conv.h:41,
                 from /usr/local/lib/gcc6/include/c++/locale:43,
                 from /usr/local/lib/gcc6/include/c++/iomanip:43,
                 from timer.h:6,
                 from util.cpp:34:
/usr/local/lib/gcc6/include/c++/tuple:1337:5: note: candidate: template<class ... _TElements, class ... _UElements> constexpr bool std::operator==(const std::tuple<_Elements ...>&, const std::tuple<_Elements ...>&)
     operator==(const tuple<_TElements...>& __t,
     ^~~~~~~~
/usr/local/lib/gcc6/include/c++/tuple:1337:5: note:   template argument deduction/substitution failed:
util.cpp:80:21: note:   'mfstream' is not derived from 'const std::tuple<_Elements ...>'
   if (fileStream == 0)
                     ^
In file included from /usr/local/lib/gcc6/include/c++/bits/locale_conv.h:41:0,
                 from /usr/local/lib/gcc6/include/c++/locale:43,
                 from /usr/local/lib/gcc6/include/c++/iomanip:43,
                 from timer.h:6,
                 from util.cpp:34:
/usr/local/lib/gcc6/include/c++/bits/unique_ptr.h:650:5: note: candidate: template<class _Tp, class _Dp, class _Up, class _Ep> bool std::operator==(const std::unique_ptr<_Tp, _Dp>&, const std::unique_ptr<_Up, _Ep>&)
     operator==(const unique_ptr<_Tp, _Dp>& __x,
     ^~~~~~~~
/usr/local/lib/gcc6/include/c++/bits/unique_ptr.h:650:5: note:   template argument deduction/substitution failed:
util.cpp:80:21: note:   'mfstream' is not derived from 'const std::unique_ptr<_Tp, _Dp>'
   if (fileStream == 0)
                     ^
In file included from /usr/local/lib/gcc6/include/c++/bits/locale_conv.h:41:0,
                 from /usr/local/lib/gcc6/include/c++/locale:43,
                 from /usr/local/lib/gcc6/include/c++/iomanip:43,
                 from timer.h:6,
                 from util.cpp:34:
/usr/local/lib/gcc6/include/c++/bits/unique_ptr.h:656:5: note: candidate: template<class _Tp, class _Dp> bool std::operator==(const std::unique_ptr<_Tp, _Dp>&, std::nullptr_t)
     operator==(const unique_ptr<_Tp, _Dp>& __x, nullptr_t) noexcept
     ^~~~~~~~
/usr/local/lib/gcc6/include/c++/bits/unique_ptr.h:656:5: note:   template argument deduction/substitution failed:
util.cpp:80:21: note:   'mfstream' is not derived from 'const std::unique_ptr<_Tp, _Dp>'
   if (fileStream == 0)
                     ^
In file included from /usr/local/lib/gcc6/include/c++/bits/locale_conv.h:41:0,
                 from /usr/local/lib/gcc6/include/c++/locale:43,
                 from /usr/local/lib/gcc6/include/c++/iomanip:43,
                 from timer.h:6,
                 from util.cpp:34:
/usr/local/lib/gcc6/include/c++/bits/unique_ptr.h:661:5: note: candidate: template<class _Tp, class _Dp> bool std::operator==(std::nullptr_t, const std::unique_ptr<_Tp, _Dp>&)
     operator==(nullptr_t, const unique_ptr<_Tp, _Dp>& __x) noexcept
     ^~~~~~~~
/usr/local/lib/gcc6/include/c++/bits/unique_ptr.h:661:5: note:   template argument deduction/substitution failed:
util.cpp:80:21: note:   mismatched types 'const std::unique_ptr<_Tp, _Dp>' and 'int'
   if (fileStream == 0)
                     ^
Comment 2 Jan Beich freebsd_committer freebsd_triage 2017-02-05 19:01:26 UTC
Landed in ports r433442.