[PATCH] Only define __cpp_lib_constexpr_char_traits for C++17
Jonathan Wakely
jwakely@redhat.com
Fri Jun 15 16:04:00 GMT 2018
On 15/06/18 16:46 +0100, Jonathan Wakely wrote:
>This macro should not be defined unconditionally.
>
>The macro isn't official (it was proposed in P0426R1 but doesn't
>appear in SD-6 or the drafts, or the C++2a working paper) so I haven't
>added any tests. Ideally we would have negative tests for each feature
>test macro, to make sure they aren't defined when the feature isn't
>available. I've done a review and this seems to be the only problem.
>
> * include/bits/char_traits.h (__cpp_lib_constexpr_char_traits): Only
> define for C++17 and above.
I'm going to backport this to gcc-7-branch and gcc-8-branch too,
because a feature test macro that lies is worse than no feature test
macro at all.
More information about the Libstdc++
mailing list