clang build error caused by HAVE_TYPE_TRAITS
|Reported by:||wojdyr||Owned by:|
On Fedora 20 wxWidgets (trunk, i haven't checked 3.0) doesn't build using clang.
The error is
In file included from ../include/wx/wxprec.h:58: In file included from ../include/wx/wx.h:15: In file included from ../include/wx/object.h:19: In file included from ../include/wx/memory.h:15: In file included from ../include/wx/string.h:46: In file included from ../include/wx/strvararg.h:25: In file included from /usr/lib/gcc/x86_64-redhat-linux/4.8.2/../../../../include/c++/4.8.2/type_traits:35: /usr/lib/gcc/x86_64-redhat-linux/4.8.2/../../../../include/c++/4.8.2/bits/c++0x_warning.h:32:2: error: This file requires compiler and library support for the ISO C++ 2011 standard. This support is currently experimental, and must be enabled with the -std=c++11 or -std=gnu++11 compiler options.
The triggered #error is after:
#if __cplusplus < 201103L
This file is included because HAVE_TYPE_TRAITS is defined.
In setup.h HAVE_TYPE_TRAITS is _not_ defined, but then in defs.h:
#if defined(__has_include) #if !defined(HAVE_TYPE_TRAITS) && __has_include(<type_traits>) #define HAVE_TYPE_TRAITS #endif
After removing the #define above it compiles.
With only two unrelated warnings.
../src/common/stopwatch.cpp:75:11: warning: unused variable 'MICROSECONDS_PER_MILLISECOND' [-Wunused-const-variable] const int MICROSECONDS_PER_MILLISECOND = 1000; ../src/gtk/print.cpp:57:21: warning: unused variable 'RAD2DEG' [-Wunused-const-variable] static const double RAD2DEG = 180.0 / M_PI;