diff options
author | Jonathan Wakely <jwakely@redhat.com> | 2020-05-23 18:27:35 +0100 |
---|---|---|
committer | Jonathan Wakely <jwakely@redhat.com> | 2020-05-23 18:27:35 +0100 |
commit | 3cb0c7cc160a50f830bfa9aa5a3264b773a28bf8 (patch) | |
tree | 2a4832c5695e311730a257ce2c97cdd659c76f53 /libstdc++-v3/include/debug | |
parent | 8df7ee67f6fdc780e9453f2baa8d1bf62c000761 (diff) |
libstdc++: Fix function that can't be constexpr in C++11 (PR 95289)
The body of this function isn't just a return statement, so it can't be
constexpr until C++14.
PR libstdc++/95289
* include/debug/helper_functions.h (__get_distance): Only declare
as a constexpr function for C++14 and up.
* testsuite/25_algorithms/copy/debug/95289.cc: New test.
Diffstat (limited to 'libstdc++-v3/include/debug')
-rw-r--r-- | libstdc++-v3/include/debug/helper_functions.h | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/libstdc++-v3/include/debug/helper_functions.h b/libstdc++-v3/include/debug/helper_functions.h index 251582d5922..62d5309257f 100644 --- a/libstdc++-v3/include/debug/helper_functions.h +++ b/libstdc++-v3/include/debug/helper_functions.h @@ -96,7 +96,7 @@ namespace __gnu_debug { return std::make_pair(__rhs - __lhs, __dp_exact); } template<typename _Iterator> - _GLIBCXX_CONSTEXPR + _GLIBCXX14_CONSTEXPR inline typename _Distance_traits<_Iterator>::__type __get_distance(_Iterator __lhs, _Iterator __rhs, std::input_iterator_tag) |