<div dir="auto">It's a bug in the mingw headers. If you pass -fms-extensions -fms-extensions, clang will accept that code since Microsoft's headers have the same bug.</div><div class="gmail_extra"><br><div class="gmail_quote">On May 7, 2017 10:05 PM, "Edward Diener via cfe-dev" <<a href="mailto:cfe-dev@lists.llvm.org">cfe-dev@lists.llvm.org</a>> wrote:<br type="attribution"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">I build clang from the latest source using mingw-64/gcc-7.1. Using mingw-64/gcc-7.1 as the backend, when I compile:<br>
<br>
// test_compiler.cpp<br>
<br>
#include <windows.h><br>
int main()<br>
{<br>
return 0;<br>
}<br>
<br>
with the command line:<br>
<br>
some_path/clang++" -c -x c++ -O0 -g -fno-inline -Wall -g -march=i686 -m32" -o "some_path\test_compiler.obj" "test_compiler.cpp"<br>
<br>
I get:<br>
<br>
In file included from test_compiler.cpp:1:<br>
In file included from C:\Utilities\mingw-w64\i686-7.<wbr>1.0-posix-dwarf-rt_v5-rev0\min<wbr>gw32\i686-w64-mingw32\include\<wbr>windows.h:69:<br>
In file included from C:\Utilities\mingw-w64\i686-7.<wbr>1.0-posix-dwarf-rt_v5-rev0\min<wbr>gw32\i686-w64-mingw32\include\<wbr>windef.h:8:<br>
In file included from C:\Utilities\mingw-w64\i686-7.<wbr>1.0-posix-dwarf-rt_v5-rev0\min<wbr>gw32\i686-w64-mingw32\include\<wbr>minwindef.h:163:<br>
C:\Utilities\mingw-w64\i686-7.<wbr>1.0-posix-dwarf-rt_v5-rev0\min<wbr>gw32\i686-w64-mingw32\include\<wbr>winnt.h:4720:18: error: default initialization of an object of const type 'const GUID' (aka 'const _GUID') without a user-provided default constructor<br>
    DEFINE_GUID (GUID_MAX_POWER_SAVINGS, 0xa1841308, 0x3541, 0x4fab, 0xbc, 0x81, 0xf7, 0x15, 0x56, 0xf2, 0x0b, 0x4a);<br>
                 ^<br>
C:\Utilities\mingw-w64\i686-7.<wbr>1.0-posix-dwarf-rt_v5-rev0\min<wbr>gw32\i686-w64-mingw32\include\<wbr>winnt.h:4721:18: error: default initialization of an object of const type 'const GUID' (aka 'const _GUID') without a user-provided default constructor<br>
    DEFINE_GUID (GUID_MIN_POWER_SAVINGS, 0x8c5e7fda, 0xe8bf, 0x4a96, 0x9a, 0x85, 0xa6, 0xe2, 0x3a, 0x8c, 0x63, 0x5c);<br>
                 ^<br>
<br>
etc. with the same errors for all the other DEFINE_GUID s in winnt.h<br>
<br>
Needless to say compiling the same source with mingw-64/gcc-7.1 directly succeeds.<br>
<br>
Is this a bug in the latest clang source ?<br>
<br>
<br>
<br>
<br>
<br>
______________________________<wbr>_________________<br>
cfe-dev mailing list<br>
<a href="mailto:cfe-dev@lists.llvm.org" target="_blank">cfe-dev@lists.llvm.org</a><br>
<a href="http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-dev" rel="noreferrer" target="_blank">http://lists.llvm.org/cgi-bin/<wbr>mailman/listinfo/cfe-dev</a><br>
</blockquote></div></div>