[Development] __has_include vs GCC

Marc Mutz marc.mutz at kdab.com
Wed Feb 8 20:40:04 CET 2017


Hi,

I just filed https://gcc.gnu.org/bugzilla/show_bug.cgi?id=79433 
complaining that __has_include returns true for headers which then, when 
included, #error out about the wrong C++ standard used.

We use this mechanism for at least <chrono>, and are either about to 
ship it or already do. That's fine since we compile at least in C++11 
mode these days.

I, however, intended to use the same feature for <string_view> and 
<experimental/string_view>, which don't seem to have SD-6 feature test 
macros (or else define them in the header which you're not allowed to 
include to check), but since we compile qmake only in C++11, not higher, 
this was greeted with an #error.

How do other compilers/platforms behave?

Thanks,
Marc




More information about the Development mailing list