* [patch] Fix clang error with std::experimental::filesystem::path
@ 2015-12-01 11:33 Jonathan Wakely
0 siblings, 0 replies; only message in thread
From: Jonathan Wakely @ 2015-12-01 11:33 UTC (permalink / raw)
To: libstdc++, gcc-patches
[-- Attachment #1: Type: text/plain, Size: 1030 bytes --]
I got a report that Clang fails to compile the filesystem lib, with
the following error:
/home/jwakely/gcc/latest/include/c++/6.0.0/experimental/bits/fs_path.h:563:18: fatal error: explicit specialization of 'std::experimental::filesystem::v1::path::__is_encoded_char<char>' after instantiation
struct path::__is_encoded_char<char> : std::true_type
^~~~~~~~~~~~~~~~~~~~~~~
/home/jwakely/gcc/latest/include/c++/6.0.0/experimental/bits/fs_path.h:104:9: note: implicit instantiation first required here
: decltype(__is_path_src(std::declval<_Source>(), 0))
^
The problem is that the path::_Cmpt constructors do overload
resolution on the path constructors, which requires the explicit
specializations of __is_encoded_char. Solved by moving the definition
of _Cmpt after the specializations.
I'm still reducing it to report a g++ bug for the missed diagnostic.
Tested powerpc64le-linux, committed to trunk. This is unfortunately
too late for 5.3, so I'll fix it on the branch when it reopens.
[-- Attachment #2: patch.txt --]
[-- Type: text/x-patch, Size: 1470 bytes --]
commit 0bd97117b71c759cbccfe9d19ea09b96c3bce472
Author: Jonathan Wakely <jwakely@redhat.com>
Date: Tue Dec 1 10:30:31 2015 +0000
Define path::_Cmpt after specializing path::__is_encoded_char
* include/experimental/bits/fs_path.h (path::_Cmpt): Move definition
after path::__is_encoded_char explicit specializations.
diff --git a/libstdc++-v3/include/experimental/bits/fs_path.h b/libstdc++-v3/include/experimental/bits/fs_path.h
index 40462a6..98820ad 100644
--- a/libstdc++-v3/include/experimental/bits/fs_path.h
+++ b/libstdc++-v3/include/experimental/bits/fs_path.h
@@ -549,16 +549,6 @@ _GLIBCXX_BEGIN_NAMESPACE_CXX11
std::string _M_what = _M_gen_what();
};
- struct path::_Cmpt : path
- {
- _Cmpt(string_type __s, _Type __t, size_t __pos)
- : path(std::move(__s), __t), _M_pos(__pos) { }
-
- _Cmpt() : _M_pos(-1) { }
-
- size_t _M_pos;
- };
-
template<>
struct path::__is_encoded_char<char> : std::true_type
{ using value_type = char; };
@@ -575,6 +565,16 @@ _GLIBCXX_BEGIN_NAMESPACE_CXX11
struct path::__is_encoded_char<char32_t> : std::true_type
{ using value_type = char32_t; };
+ struct path::_Cmpt : path
+ {
+ _Cmpt(string_type __s, _Type __t, size_t __pos)
+ : path(std::move(__s), __t), _M_pos(__pos) { }
+
+ _Cmpt() : _M_pos(-1) { }
+
+ size_t _M_pos;
+ };
+
// specialize _Cvt for degenerate 'noconv' case
template<>
struct path::_Cvt<path::value_type>
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2015-12-01 11:33 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-12-01 11:33 [patch] Fix clang error with std::experimental::filesystem::path Jonathan Wakely
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).