https://gcc.gnu.org/bugzilla/show_bug.cgi?id=79433
--- Comment #18 from Jonathan Wakely <redi at gcc dot gnu.org> --- I've started a discussion about changing the SD-6 recommendations. One idea that came out of the discussion so far would be to make a GCC-specific extension to __has_include. If the has-includes-expression finds a file then it could read the first line of the file to look for something like: #pragma GCC has_include(constant-expression) If found, the result of the has-include-expression would be 1 if the constant-expression is non-zero, and 0 otherwise. Then we could decorate our C++17 headers with: #pragma GCC has_include(__cplusplus > 201402L) and __has_include would magically give the right answer.