This is the mail archive of the
libstdc++@gcc.gnu.org
mailing list for the libstdc++ project.
Re: [PATCH] Only define __cpp_lib_constexpr_char_traits for C++17
- From: Jonathan Wakely <jwakely at redhat dot com>
- To: libstdc++ at gcc dot gnu dot org, gcc-patches at gcc dot gnu dot org
- Date: Fri, 15 Jun 2018 17:04:50 +0100
- Subject: Re: [PATCH] Only define __cpp_lib_constexpr_char_traits for C++17
- References: <20180615154656.GA8709@redhat.com>
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.