[forwarded from https://bugs.debian.org/839995] The Debian issue has an unreduced test case, and a proposed fix. $ g++ -c MiniDriverContainerpreprocess.cpp In file included from /usr/include/c++/6/locale:43:0, from /usr/include/c++/6/iomanip:43, from Log.hpp:31, from MiniDriverContainer.hpp:33, from MiniDriverContainer.cpp:22: /usr/include/c++/6/bits/locale_conv.h: In member function 'std::__cxx11::wstring_convert<_Codecvt, _Elem, _Wide_alloc, _Byte_alloc>::wide_string std::__cxx11::wstring_convert<_Codecvt, _Elem, _Wide_alloc, _Byte_alloc>::from_bytes(const char*, const char*)': /usr/include/c++/6/bits/locale_conv.h:250:40: error: expected primary-expression before ',' token if (__str_codecvt_in(__first, __last, __out, *_M_cvt, _M_state, ^ /usr/include/c++/6/bits/locale_conv.h:252:4: error: return-statement with no value, in function returning 'std::__cxx11::wstring_convert<_Codecvt, _Elem, _Wide_alloc, _Byte_alloc>::wide_string' [-fpermissive] return __out; ^~~~~~ /usr/include/c++/6/bits/locale_conv.h: In member function 'std::__cxx11::wstring_convert<_Codecvt, _Elem, _Wide_alloc, _Byte_alloc>::byte_string std::__cxx11::wstring_convert<_Codecvt, _Elem, _Wide_alloc, _Byte_alloc>::to_bytes(const _Elem*, const _Elem*)': /usr/include/c++/6/bits/locale_conv.h:286:41: error: expected primary-expression before ',' token if (__str_codecvt_out(__first, __last, __out, *_M_cvt, _M_state, ^ /usr/include/c++/6/bits/locale_conv.h:288:4: error: return-statement with no value, in function returning 'std::__cxx11::wstring_convert<_Codecvt, _Elem, _Wide_alloc, _Byte_alloc>::byte_string' [-fpermissive] return __out; ^~~~~~ In file included from /usr/include/c++/6/locale:43:0, from /usr/include/c++/6/iomanip:43, from Log.hpp:31, from MiniDriverContainer.hpp:33, from MiniDriverContainer.cpp:22: /usr/include/c++/6/bits/locale_conv.h: In member function 'typename std::wbuffer_convert<_Codecvt, _Elem, _Tr>::_Wide_streambuf::int_type std::wbuffer_convert<_Codecvt, _Elem, _Tr>::overflow(typename std::wbuffer_convert<_Codecvt, _Elem, _Tr>::_Wide_streambuf::int_type)': /usr/include/c++/6/bits/locale_conv.h:382:29: error: expected primary-expression before ',' token else if (!_Tr::eq_int_type(__out, _Tr::eof())) ^
Who is defining __out ?
(In reply to Andrew Pinski from comment #1) > Who is defining __out ? Which you can find out by -dD (or -g3). I suspect this is not a bug in libstdc++ but the headers of the program that is being compiled.
This is a bug in libgtop11dotnet: ./cardmod.h:#define __out ./cardmod.h:#define __out_bcount_part_opt(x, y) ./cardmod.h:#define __out_bcount(x) ./cardmod.h:#define __out_opt __ is in the implementation namespace but they are abusing it.
(In reply to Andrew Pinski from comment #3) > This is a bug in libgtop11dotnet: > > > ./cardmod.h:#define __out > ./cardmod.h:#define __out_bcount_part_opt(x, y) > ./cardmod.h:#define __out_bcount(x) > ./cardmod.h:#define __out_opt > > > __ is in the implementation namespace but they are abusing it. Basically they are trying to compile the sources under both MSVC++ and GCC but default to MSVC++'s source style in a way it is undefined for other compilers.