To summarize, c++ doesn't work in a native build for x86_64-pc-mingw32. We have
found that not all of c++ is broken, and I've been narrowing it down further.
The problem manifests itself as a segfault and ICE that is only visible when
you use the -E switch -- otherwise, the failure is silent. This in and of
itself I think is a bug, and we should report it to gcc. 

The segfault can be triggered by #including a c++ header like iostream or
cmath. Further digging reveals that it's not all of the headers. I found that
for instance cassert works fine. I've been able to narrow down cmath's failure
due to including <ext/type_traits.h>, and this might be the failure point for
everything.

I think I've found a reduced test case... 

#include <bits/c++config.h> 
#include <bits/cpp_type_traits.h> 
template<bool, typename> 
struct __enable_if 
{ }; 

template<typename _Tp> 
struct __enable_if<true, _Tp> 
{ typedef _Tp __type; }; 

int main() {return 0; } 



That code is taken from the ext/type_traits.h header. It doesn't give any error
(and no segfault in the -E output), but it won't compile. If you get rid of the
second template, it will compile and link to create an executable. This is, I
think, getting much closer to the heart of the problem. I think we should post
on gcc soon for this.


-- 
           Summary: g++ inoperable with no error message
           Product: gcc
           Version: unknown
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c++
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: nightstrike at gmail dot com
  GCC host triplet: x86_64-pc-mingw32
GCC target triplet: x86_64-pc-mingw32


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=35159

Reply via email to