The following error occurs when using g++.
[mingw-w64 version]
trunk r6470
[test code - test.cpp]
#include <cmath> int main () { float f; isnan(f); return 0; }
[command line]
g++ test.cpp
[error log]
In file included from d:\dev\msys32\mingw\i686-w64-mingw32\include\c++\4.8.2\cmath:44:0, from test.cpp:1: test.cpp: In function 'int main()': test.cpp:5:10: error: expected primary-expression before '__typeof__' float f; isnan(f); ^ test.cpp:5:10: error: expected primary-expression before 'double' float f; isnan(f); ^ test.cpp:5:10: error: '__builtin_types_compatible_p' was not declared in this scope float f; isnan(f); ^ test.cpp:5:10: error: expected primary-expression before '__typeof__' float f; isnan(f); ^ test.cpp:5:10: error: expected primary-expression before 'float' float f; isnan(f); ^ test.cpp:5:10: error: expected primary-expression before '__typeof__' float f; isnan(f); ^ test.cpp:5:10: error: expected primary-expression before 'long' float f; isnan(f); ^ test.cpp:5:10: error: '__builtin_choose_expr' was not declared in this scope float f; isnan(f); ^ test.cpp:5:10: error: '__builtin_choose_expr' was not declared in this scope float f; isnan(f); ^ test.cpp:5:10: error: redeclaration of '<typeprefixerror>__builtin_choose_expr' test.cpp:5:10: note: previous declaration '<typeprefixerror>__builtin_choose_expr' float f; isnan(f); ^ test.cpp:5:10: error: '__builtin_choose_expr' was not declared in this scope float f; isnan(f); ^ test.cpp:5:10: error: redeclaration of '<typeprefixerror>__builtin_choose_expr' test.cpp:5:10: note: previous declaration '<typeprefixerror>__builtin_choose_expr' float f; isnan(f); ^
This error was ocurred in configure script of llvm-3.4.
Please confirm attached files.
Thank you.
Issue also happens on the Fedora MinGW toolchain (using recent mingw-w64 trunk snapshots): https://bugzilla.redhat.com/show_bug.cgi?id=1061443
MinGW-w64 Commit r6463 is the likely culprit of this issue as it changed the implementation of various macros like isnan and signbit: https://sourceforge.net/p/mingw-w64/code/6463/
Issue fixed on trunk at rev. 6476 & rev. 6477