2017-09-12 Jonathan Wakely <jwakely@redhat.com>
+ PR libstdc++/79433
+ * doc/xml/manual/status_cxx2017.xml: Update feature-test macros.
+ * doc/html/*: Regenerate.
+ * include/Makefile.am: Remove <bits/c++17_warning.h>.
+ * include/Makefile.in: Regenerate.
+ * include/bits/c++17_warning.h: Remove.
+ * include/bits/string_view.tcc: Do not include <bits/c++17_warning.h>
+ for pre-C++17 modes.
+ * include/std/any: Likewise.
+ (__cpp_lib_any): Define.
+ * include/std/mutex (__cpp_lib_scoped_lock): Adjust value as per new
+ SD-6 draft.
+ * include/std/numeric (__cpp_lib_gcd_lcm): Define as per new SD-6
+ draft.
+ * include/std/optional: Do not include <bits/c++17_warning.h>.
+ (__cpp_lib_optional): Define.
+ * include/std/shared_mutex: Do not include <bits/c++14_warning.h>.
+ * include/std/string_view: Do not include <bits/c++17_warning.h>.
+ (__cpp_lib_string_view): Define.
+ * include/std/variant: Do not include <bits/c++17_warning.h>.
+ (__cpp_lib_variant): Define.
+ * testsuite/20_util/optional/cons/value_neg.cc: Adjust dg-error line
+ numbers.
+ * testsuite/26_numerics/gcd/1.cc: Test for __cpp_lib_gcd_lcm.
+ * testsuite/26_numerics/gcd/gcd_neg.cc: Adjust dg-error line
+ numbers.
+ * testsuite/26_numerics/lcm/1.cc: Test for __cpp_lib_gcd_lcm.
+ * testsuite/26_numerics/lcm/lcm_neg.cc: Adjust dg-error line
+ numbers.
+ * testsuite/30_threads/scoped_lock/requirements/typedefs.cc: Adjust
+ expected value of __cpp_lib_scoped_lock.
+
PR libstdc++/70483
* include/experimental/bits/string_view.tcc (basic_string_view::find)
(basic_string_view::rfind, basic_string_view::find_first_of)
</link>
</entry>
<entry align="center"> 7 </entry>
- <entry> <code>__has_include(<variant>)</code> </entry>
+ <entry> <code>__has_include(<variant>)</code>,
+ <code>__cpp_lib_variant >= 201603</code>
+ </entry>
</row>
<row>
</link>
</entry>
<entry align="center"> 7 </entry>
- <entry> <code>__has_include(<optional>)</code> </entry>
+ <entry> <code>__has_include(<optional>)</code>,
+ <code>__cpp_lib_optional >= 201603</code>
+ </entry>
</row>
<row>
</link>
</entry>
<entry align="center"> 7 </entry>
- <entry> <code>__has_include(<any>)</code> </entry>
+ <entry> <code>__has_include(<any>)</code>,
+ <code>__cpp_lib_any >= 201603</code>
+ </entry>
</row>
<row>
</link>
</entry>
<entry align="center"> 7 </entry>
- <entry> <code>__has_include(<string_view>)</code> </entry>
+ <entry> <code>__has_include(<string_view>)</code>,
+ <code>__cpp_lib_string_view >= 201603</code>
+ </entry>
</row>
<row>
</link>
</entry>
<entry align="center"> No </entry>
- <entry> <code>__has_include(<memory_resource>)</code> </entry>
+ <entry> <code>__has_include(<memory_resource>)</code>,
+ <code>__cpp_lib_memory_resource >= 201603</code>
+ </entry>
</row>
<row>
</entry>
<entry align="center"> No </entry>
<entry><code> __has_include(<execution>) </code>,
- <code> __cpp_lib_parallel_algorithm >= 201603 </code></entry>
+ <code> __cpp_lib_execution >= 201603 </code>,
+ <code> __cpp_lib_parallel_algorithm >= 201603 </code>
+ </entry>
</row>
<row>
</link>
</entry>
<entry align="center"> 7 </entry>
- <entry><code> __cpp_lib_gcd >= 201606 </code>,
- <code> __cpp_lib_lcm >= 201606 </code>
- </entry>
+ <entry><code> __cpp_lib_gcd_lcm >= 201606 </code></entry>
</row>
<row>
${bits_srcdir}/boost_concept_check.h \
${bits_srcdir}/c++0x_warning.h \
${bits_srcdir}/c++14_warning.h \
- ${bits_srcdir}/c++17_warning.h \
${bits_srcdir}/char_traits.h \
${bits_srcdir}/codecvt.h \
${bits_srcdir}/concept_check.h \
${bits_srcdir}/boost_concept_check.h \
${bits_srcdir}/c++0x_warning.h \
${bits_srcdir}/c++14_warning.h \
- ${bits_srcdir}/c++17_warning.h \
${bits_srcdir}/char_traits.h \
${bits_srcdir}/codecvt.h \
${bits_srcdir}/concept_check.h \
+++ /dev/null
-// Copyright (C) 2016-2017 Free Software Foundation, Inc.
-//
-// This file is part of the GNU ISO C++ Library. This library is free
-// software; you can redistribute it and/or modify it under the
-// terms of the GNU General Public License as published by the
-// Free Software Foundation; either version 3, or (at your option)
-// any later version.
-
-// This library is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-// GNU General Public License for more details.
-
-// Under Section 7 of GPL version 3, you are granted additional
-// permissions described in the GCC Runtime Library Exception, version
-// 3.1, as published by the Free Software Foundation.
-
-// You should have received a copy of the GNU General Public License and
-// a copy of the GCC Runtime Library Exception along with this program;
-// see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
-// <http://www.gnu.org/licenses/>.
-
-/** @file bits/c++17_warning.h
- * This is an internal header file, included by other library headers.
- * Do not attempt to use it directly. @headername{iosfwd}
- */
-
-#ifndef _CXX17_WARNING_H
-#define _CXX17_WARNING_H 1
-
-#if __cplusplus <= 201402L
-#error This file requires compiler and library support \
-for the ISO C++ 2017 standard. This support must be enabled \
-with the -std=c++17 or -std=gnu++17 compiler options.
-#endif
-
-#endif
#pragma GCC system_header
-#if __cplusplus <= 201402L
-# include <bits/c++17_warning.h>
-#else
+#if __cplusplus >= 201703L
namespace std _GLIBCXX_VISIBILITY(default)
{
#pragma GCC system_header
-#if __cplusplus <= 201402L
-# include <bits/c++17_warning.h>
-#else
+#if __cplusplus >= 201703L
#include <typeinfo>
#include <new>
#endif
}
+#define __cpp_lib_any 201603
+
/**
* @brief A type-safe container of any type.
*
}
}
-#if __cplusplus > 201402L
-#define __cpp_lib_scoped_lock 201707
+#if __cplusplus >= 201703L
+#define __cpp_lib_scoped_lock 201703
/** @brief A scoped lock type for multiple lockable objects.
*
* A scoped_lock controls mutex ownership within a scope, releasing
#if __cplusplus > 201402L
+#define __cpp_lib_gcd_lcm 201606
+// These were used in drafts of SD-6:
#define __cpp_lib_gcd 201606
+#define __cpp_lib_lcm 201606
+
/// Greatest common divisor
template<typename _Mn, typename _Nn>
constexpr common_type_t<_Mn, _Nn>
return __detail::__gcd(__m, __n);
}
-#define __cpp_lib_lcm 201606
/// Least common multiple
template<typename _Mn, typename _Nn>
constexpr common_type_t<_Mn, _Nn>
#ifndef _GLIBCXX_OPTIONAL
#define _GLIBCXX_OPTIONAL 1
-#if __cplusplus <= 201402L
-# include <bits/c++17_warning.h>
-#else
+#pragma GCC system_header
+
+#if __cplusplus >= 201703L
#include <utility>
#include <type_traits>
* @{
*/
+#define __cpp_lib_optional 201603
+
template<typename _Tp>
class optional;
#pragma GCC system_header
-#if __cplusplus <= 201103L
-# include <bits/c++14_warning.h>
-#else
+#if __cplusplus >= 201402L
#include <bits/c++config.h>
#include <condition_variable>
#ifdef _GLIBCXX_USE_C99_STDINT_TR1
#ifdef _GLIBCXX_HAS_GTHREADS
-#if __cplusplus > 201402L
+#if __cplusplus >= 201703L
#define __cpp_lib_shared_mutex 201505
class shared_mutex;
#endif
#pragma GCC system_header
-#if __cplusplus <= 201402L
-# include <bits/c++17_warning.h>
-#else
+#if __cplusplus >= 201703L
#include <limits>
#include <iosfwd>
{
_GLIBCXX_BEGIN_NAMESPACE_VERSION
+#define __cpp_lib_string_view 201603
+
/**
* @class basic_string_view <string_view>
* @brief A non-owning reference to a string.
#pragma GCC system_header
-#if __cplusplus <= 201402L
-# include <bits/c++17_warning.h>
-#else
+#if __cplusplus >= 201703L
#include <type_traits>
#include <utility>
} // namespace __variant
} // namespace __detail
+#define __cpp_lib_variant 201603
+
template<typename... _Types> class tuple;
template<typename... _Types> class variant;
template <typename> struct hash;
std::optional<std::unique_ptr<int>> oup2 = new int; // { dg-error "conversion" }
struct U { explicit U(std::in_place_t); };
std::optional<U> ou(std::in_place); // { dg-error "no matching" }
- // { dg-error "no type" "" { target { *-*-* } } 493 }
- // { dg-error "no type" "" { target { *-*-* } } 503 }
- // { dg-error "no type" "" { target { *-*-* } } 560 }
+ // { dg-error "no type" "" { target { *-*-* } } 495 }
+ // { dg-error "no type" "" { target { *-*-* } } 505 }
+ // { dg-error "no type" "" { target { *-*-* } } 562 }
}
}
#include <numeric>
-#ifndef __cpp_lib_gcd
+#ifndef __cpp_lib_gcd_lcm
# error "Feature-test macro for gcd missing"
-#elif __cpp_lib_gcd != 201606
+#elif __cpp_lib_gcd_lcm != 201606
# error "Feature-test macro for gcd has wrong value"
#endif
std::gcd(0.1, 0.1); // { dg-error "from here" }
}
-// { dg-error "integers" "" { target *-*-* } 130 }
-// { dg-error "integers" "" { target *-*-* } 131 }
-// { dg-error "not bools" "" { target *-*-* } 132 }
-// { dg-error "not bools" "" { target *-*-* } 133 }
+// { dg-error "integers" "" { target *-*-* } 134 }
+// { dg-error "integers" "" { target *-*-* } 135 }
+// { dg-error "not bools" "" { target *-*-* } 136 }
+// { dg-error "not bools" "" { target *-*-* } 137 }
// { dg-prune-output "deleted function" }
// { dg-prune-output "invalid operands" }
#include <numeric>
-#ifndef __cpp_lib_lcm
+#ifndef __cpp_lib_gcd_lcm
# error "Feature-test macro for lcm missing"
-#elif __cpp_lib_lcm != 201606
+#elif __cpp_lib_gcd_lcm != 201606
# error "Feature-test macro for lcm has wrong value"
#endif
std::lcm(0.1, 0.1); // { dg-error "from here" }
}
-// { dg-error "integers" "" { target *-*-* } 143 }
-// { dg-error "integers" "" { target *-*-* } 144 }
-// { dg-error "not bools" "" { target *-*-* } 145 }
-// { dg-error "not bools" "" { target *-*-* } 146 }
+// { dg-error "integers" "" { target *-*-* } 146 }
+// { dg-error "integers" "" { target *-*-* } 147 }
+// { dg-error "not bools" "" { target *-*-* } 148 }
+// { dg-error "not bools" "" { target *-*-* } 149 }
// { dg-prune-output "deleted function" }
// { dg-prune-output "invalid operands" }
#ifndef __cpp_lib_scoped_lock
# error "Feature-test macro for scoped_lock missing"
-#elif __cpp_lib_scoped_lock != 201707
+#elif __cpp_lib_scoped_lock != 201703
# error "Feature-test macro for scoped_lock has wrong value"
#endif