[Bug c++/79433] __has_include reports wrong result for std headers that #error on __cplusplus

redi at gcc dot gnu.org gcc-bugzilla@gcc.gnu.org
Thu Feb 9 02:54:00 GMT 2017


https://gcc.gnu.org/bugzilla/show_bug.cgi?id=79433

--- Comment #8 from Jonathan Wakely <redi at gcc dot gnu.org> ---
I guess another, novel, option would be a __try_include directive:

#ifdef __try_include
# if __try_include(<string_view>)
// it was included without error
# else
// it wasn't found, or gave an error
# endif
#endif


More information about the Gcc-bugs mailing list