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

--- Comment #22 from Marc Mutz <marc.mutz at kdab dot com> ---
(In reply to Jonathan Wakely from comment #18)
> 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.

Would that make its way into GCC 7, so we (Qt) could rely on it working at
least for the C++17 headers (C++14 didn't add many/any)?

Reply via email to