[Bug libstdc++/95289] [10/11 Regression] __gnu_debug::__get_distance is not C++11 constexpr compliant

cvs-commit at gcc dot gnu.org gcc-bugzilla@gcc.gnu.org
Sat May 23 17:27:48 GMT 2020


--- Comment #1 from CVS Commits <cvs-commit at gcc dot gnu.org> ---
The master branch has been updated by Jonathan Wakely <redi@gcc.gnu.org>:


commit r11-589-g3cb0c7cc160a50f830bfa9aa5a3264b773a28bf8
Author: Jonathan Wakely <jwakely@redhat.com>
Date:   Sat May 23 18:27:35 2020 +0100

    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.

More information about the Gcc-bugs mailing list