]> gcc.gnu.org Git - gcc.git/commit
libstdc++: Fix macro redefinition warnings
authorJonathan Wakely <jwakely@redhat.com>
Thu, 10 Sep 2020 17:51:24 +0000 (18:51 +0100)
committerJonathan Wakely <jwakely@redhat.com>
Thu, 10 Sep 2020 17:51:24 +0000 (18:51 +0100)
commitf903c13ce8674c623f176eaf4516505205fefcf6
treeac0ae63939ce7064f71b4df0cef161104b1dbeeb
parent0943b558171ffc731577c428d6c5f81897b6a034
libstdc++: Fix macro redefinition warnings

Including <version> after <iterator> gives a warning about redefining
the __cpp_lib_array_constexpr macro. What happens is that <iterator>
sets the C++20 value, then <version> redefines it to the C++17 value,
then undefines it and defines it again to the C++20 value.

This change avoids defining it to the C++17 value when compiling C++20
or later (which also means we no longer need the #undef).

A similar warning happens for __cpp_lib_constexpr_char_traits when
including <version> after any header that includes <bits/char_traits.h>.

libstdc++-v3/ChangeLog:

* include/std/version (__cpp_lib_array_constexpr):
(__cpp_lib_constexpr_char_traits): Only define C++17 value when
compiling C++17.
libstdc++-v3/include/std/version
This page took 0.056914 seconds and 5 git commands to generate.