From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 2181) id 8453A385841A; Fri, 15 Oct 2021 23:48:30 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 8453A385841A MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset="utf-8" From: Jonathan Wakely To: gcc-cvs@gcc.gnu.org, libstdc++-cvs@gcc.gnu.org Subject: [gcc r12-4455] libstdc++: Fix error in filesystem::path with Clang X-Act-Checkin: gcc X-Git-Author: Jonathan Wakely X-Git-Refname: refs/heads/master X-Git-Oldrev: 929abc7fe3ad4491ac412ca232e055618559f268 X-Git-Newrev: e547d1341b1fe90672c9b982c4a98f8197237bb7 Message-Id: <20211015234830.8453A385841A@sourceware.org> Date: Fri, 15 Oct 2021 23:48:30 +0000 (GMT) X-BeenThere: libstdc++-cvs@gcc.gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Libstdc++-cvs mailing list List-Unsubscribe: , List-Archive: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 15 Oct 2021 23:48:30 -0000 https://gcc.gnu.org/g:e547d1341b1fe90672c9b982c4a98f8197237bb7 commit r12-4455-ge547d1341b1fe90672c9b982c4a98f8197237bb7 Author: Jonathan Wakely Date: Fri Oct 15 23:27:54 2021 +0100 libstdc++: Fix error in filesystem::path with Clang THis fixes teh following error seen with Clang: error: function '_S_convert>' with deduced return type cannot be used before it is defined return string_type(_S_convert(std::u8string_view(__str))); ^ libstdc++-v3/ChangeLog: * include/bits/fs_path.h (path::_S_convert(T)): Avoid recursive call to function with deduced return type. Diff: --- libstdc++-v3/include/bits/fs_path.h | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/libstdc++-v3/include/bits/fs_path.h b/libstdc++-v3/include/bits/fs_path.h index d13fb12455c..4bd980952f1 100644 --- a/libstdc++-v3/include/bits/fs_path.h +++ b/libstdc++-v3/include/bits/fs_path.h @@ -630,7 +630,8 @@ namespace __detail // Calling _S_convert will return a u8string_view that // refers to __str and would dangle after this function returns. // Return a string_type instead, to avoid dangling. - return string_type(_S_convert(std::u8string_view(__str))); + return string_type(_S_convert(__str.data(), + __str.data() + __str.size())); #endif else return _S_convert(__str.data(), __str.data() + __str.size());