Hi Everyone

I can't build the popular build program ninja with clang++ and mingw.

The reason is demonstrated by this simple program:

// wcx.cpp

#include <string>
using namespace std;
#include <windows.h>
int main()
{
    wchar_t* p = wcschr(L"hello", L'h');
}

Compiling this program with g++ yields the same problem, all the errors are
below, results from clang++ are included too.

g++ -std=c++1y -I/libcxx/include -nostdinc++ wcx.cpp


If ninja didn't put a using namespace std; in it's includes, the problem
would go away, but it does, and in over a year I've had no luck convincing
them not to put using namespaces in headers and when I mentioned it a year
ago here it didn't attract any interest.

On the ninja maintainers side, it is legal, so why should they change it,
and who knows what other programs break because it doesn't work.

So my question is, will mingw be changed to make this program compile by
default?

If there is a fix, where (actual link please) can I get it?

I'm using a mingw I got here:

http://sourceforge.net/projects/mingw-w64/files/Toolchains%20targetting%20Win64/Personal%20Builds/mingw-builds/4.9.0/threads-win32/seh/x86_64-4.9.0-release-win32-seh-rt_v3-rev0.7z/download

It'd be nice if someone actually tried this. Everything you need is listed
to reproduce the problem: Binaries, test case, compile command lines.
ninja source is available too so you can even download that, not that you
need it, the test case demonstrates the problem.

Also, regarding my earlier post, could someone tell me explicitly what the
procedure would be to either get the latest trunk mingw to apply to the
build linked above if that's what I'm supposed to do, or where a more
recent version of that is that fixes that problem so I can download that?

I find navigating the various personal builds/mingw builds tree very
confusing.

Whatever I download is always "old" whenever I try to discuss anything on
here. Nobody links to anything concrete in their replies.

I'm not an expert in mingw and I always find I'm chasing my tail most of
the time on this forum to get replies that I can actually do anything with,
despite attempts from people to help, and that's regardless of however much
info I provide.

Hopefully this time will be different.

Error output follows.

Thanks

In file included from /libcxx/include/memory:607:0,
                 from /libcxx/include/algorithm:628,
                 from /libcxx/include/string:439,
                 from wcx.cpp:1:
/libcxx/include/tuple:291:72: error: 'constexpr const _Hp&
std::__1::__tuple_leaf<_Ip, _Hp, <anonymous> >::get() const' ca
nnot be overloaded
     _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX11 const _Hp&
get() const _NOEXCEPT {return value;}
                                                                        ^
/libcxx/include/tuple:290:72: error: with 'constexpr _Hp&
std::__1::__tuple_leaf<_Ip, _Hp, <anonymous> >::get() const'
     _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX11       _Hp&
get()       _NOEXCEPT {return value;}
                                                                        ^
In file included from /libcxx/include/memory:607:0,
                 from /libcxx/include/algorithm:628,
                 from /libcxx/include/string:439,
                 from wcx.cpp:1:
/libcxx/include/tuple:357:72: error: 'constexpr const _Hp&
std::__1::__tuple_leaf<_Ip, _Hp, true>::get() const' cannot be
overloaded
     _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX11 const _Hp&
get() const _NOEXCEPT {return static_cast<const _H
p&>(*this);}
                                                                        ^
In file included from /libcxx/include/memory:607:0,
                 from /libcxx/include/algorithm:628,
                 from /libcxx/include/string:439,
                 from wcx.cpp:1:
/libcxx/include/tuple:356:72: error: with 'constexpr _Hp&
std::__1::__tuple_leaf<_Ip, _Hp, true>::get() const'
     _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX11       _Hp&
get()       _NOEXCEPT {return static_cast<_Hp&>(*t
his);}
                                                                        ^
In file included from /libcxx/include/memory:607:0,
                 from /libcxx/include/algorithm:628,
                 from /libcxx/include/string:439,
                 from wcx.cpp:1:
/libcxx/include/tuple: In function 'constexpr std::__1::tuple<>
std::__1::tuple_cat()':
/libcxx/include/tuple:996:1: error: invalid return type 'std::__1::tuple<>'
of constexpr function 'constexpr std::__1::tup
le<> std::__1::tuple_cat()'
 tuple_cat()
 ^
/libcxx/include/tuple:674:29: note: 'std::__1::tuple<>' is not literal
because:
 class _LIBCPP_TYPE_VIS_ONLY tuple<>
                             ^
/libcxx/include/tuple:674:29: note:   'std::__1::tuple<>' is not an
aggregate, does not have a trivial default constructor
, and has no constexpr constructor that is not a copy or move constructor
wcx.cpp: In function 'int main()':
wcx.cpp:6:39: error: call of overloaded 'wcschr(const wchar_t [6],
wchar_t)' is ambiguous
     wchar_t* p = wcschr(L"hello", L'h');
                                       ^
wcx.cpp:6:39: note: candidates are:
In file included from /libcxx/include/iosfwd:90:0,
                 from /libcxx/include/string:435,
                 from wcx.cpp:1:
c:/mingw/x86_64-w64-mingw32/include/wchar.h:840:34: note: wchar_t*
wcschr(const wchar_t*, wchar_t)
   _CONST_RETURN wchar_t *__cdecl wcschr(const wchar_t *_Str,wchar_t _Ch);
                                  ^
In file included from /libcxx/include/string:438:0,
                 from wcx.cpp:1:
/libcxx/include/cwchar:181:49: note: wchar_t* std::__1::wcschr(wchar_t*,
wchar_t)
 inline _LIBCPP_INLINE_VISIBILITY       wchar_t* wcschr(      wchar_t* __s,
wchar_t __c) {return ::wcschr(__s, __c);}
                                                 ^
/libcxx/include/cwchar:180:49: note: const wchar_t* std::__1::wcschr(const
wchar_t*, wchar_t)
 inline _LIBCPP_INLINE_VISIBILITY const wchar_t* wcschr(const wchar_t* __s,
wchar_t __c) {return ::wcschr(__s, __c);}
                                                 ^
Compiling with clang++ give something similar:


c:\test>clang++ -std=c++1y -I/libcxx/include -nostdinc++ wcx.cpp
wcx.cpp:6:18: error: call to 'wcschr' is ambiguous
    wchar_t* p = wcschr(L"hello", L'h');
                 ^~~~~~
c:\mingw\bin\..\lib\clang\3.5.0\../../../x86_64-w64-mingw32/include\wchar.h:840:34:
note: candidate function
  _CONST_RETURN wchar_t *__cdecl wcschr(const wchar_t *_Str,wchar_t _Ch);
                                 ^
/libcxx/include\cwchar:180:49: note: candidate function
inline _LIBCPP_INLINE_VISIBILITY const wchar_t* wcschr(const wchar_t* __s,
wchar_t __c) {return ::wcschr(__s, __c);}
                                                ^
/libcxx/include\cwchar:181:49: note: candidate function
inline _LIBCPP_INLINE_VISIBILITY       wchar_t* wcschr(      wchar_t* __s,
wchar_t __c) {return ::wcschr(__s, __c);}
------------------------------------------------------------------------------
"Accelerate Dev Cycles with Automated Cross-Browser Testing - For FREE
Instantly run your Selenium tests across 300+ browser/OS combos.  Get 
unparalleled scalability from the best Selenium testing platform available.
Simple to use. Nothing to install. Get started now for free."
http://p.sf.net/sfu/SauceLabs
_______________________________________________
Mingw-w64-public mailing list
Mingw-w64-public@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/mingw-w64-public

Reply via email to