libstdc++: Fix function that can't be constexpr in C++11 (PR 95289)
authorJonathan Wakely <jwakely@redhat.com>
Sat, 23 May 2020 17:27:35 +0000 (18:27 +0100)
committerJonathan Wakely <jwakely@redhat.com>
Sat, 23 May 2020 17:27:35 +0000 (18:27 +0100)
commit3cb0c7cc160a50f830bfa9aa5a3264b773a28bf8
tree2a4832c5695e311730a257ce2c97cdd659c76f53
parent8df7ee67f6fdc780e9453f2baa8d1bf62c000761
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.
libstdc++-v3/ChangeLog
libstdc++-v3/include/debug/helper_functions.h
libstdc++-v3/testsuite/25_algorithms/copy/debug/95289.cc [new file with mode: 0644]