https://gcc.gnu.org/bugzilla/show_bug.cgi?id=93983

Paco Arjonilla <pacoarjonilla at yahoo dot es> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |pacoarjonilla at yahoo dot es

--- Comment #4 from Paco Arjonilla <pacoarjonilla at yahoo dot es> ---
I got this error too. This is the code:



#include <filesystem>
#include <concepts>
struct A {
    A() = default;
    A(A const&) = default;
    A & operator = (A const&) = default;

    A(std::filesystem::path); // This line triggers the error.
};
static_assert(std::semiregular<A>);



There is no reason why an extra constructor would affect the semiregularity of
a type.



$> g++ -std=c++20

In file included from
/opt/compiler-explorer/gcc-trunk-20200321/include/c++/10.0.1/compare:39,

                 from
/opt/compiler-explorer/gcc-trunk-20200321/include/c++/10.0.1/bits/stl_pair.h:65,

                 from
/opt/compiler-explorer/gcc-trunk-20200321/include/c++/10.0.1/bits/stl_algobase.h:64,

                 from
/opt/compiler-explorer/gcc-trunk-20200321/include/c++/10.0.1/bits/char_traits.h:39,

                 from
/opt/compiler-explorer/gcc-trunk-20200321/include/c++/10.0.1/string:40,

                 from
/opt/compiler-explorer/gcc-trunk-20200321/include/c++/10.0.1/stdexcept:39,

                 from
/opt/compiler-explorer/gcc-trunk-20200321/include/c++/10.0.1/system_error:41,

                 from
/opt/compiler-explorer/gcc-trunk-20200321/include/c++/10.0.1/bits/fs_fwd.h:35,

                 from
/opt/compiler-explorer/gcc-trunk-20200321/include/c++/10.0.1/filesystem:44,

                 from <source>:1:

/opt/compiler-explorer/gcc-trunk-20200321/include/c++/10.0.1/bits/stl_iterator_base_types.h:
In instantiation of 'struct std::iterator_traits<A>':

/opt/compiler-explorer/gcc-trunk-20200321/include/c++/10.0.1/bits/fs_path.h:84:11:
  required by substitution of 'template<class _Iter, class _Iter_traits> using
__is_path_iter_src = std::__and_<std::__or_<std::is_same<typename
std::remove_const<typename _Iter_traits::value_type>::type, char>,
std::is_same<typename std::remove_const<typename
_Iter_traits::value_type>::type, char8_t>, std::is_same<typename
std::remove_const<typename _Iter_traits::value_type>::type, wchar_t>,
std::is_same<typename std::remove_const<typename
_Iter_traits::value_type>::type, char16_t>, std::is_same<typename
std::remove_const<typename _Iter_traits::value_type>::type, char32_t> >,
std::is_base_of<std::input_iterator_tag, typename
_Iter_traits::iterator_category> > [with _Iter = A; _Iter_traits =
std::iterator_traits<A>]'

/opt/compiler-explorer/gcc-trunk-20200321/include/c++/10.0.1/bits/fs_path.h:91:5:
  required by substitution of 'template<class _Iter>
std::filesystem::__cxx11::__detail::__is_path_iter_src<_Iter>
std::filesystem::__cxx11::__detail::__is_path_src(_Iter, int) [with _Iter = A]'

/opt/compiler-explorer/gcc-trunk-20200321/include/c++/10.0.1/bits/fs_path.h:115:29:
  required from 'struct
std::filesystem::__cxx11::__detail::__constructible_from<A, void>'

/opt/compiler-explorer/gcc-trunk-20200321/include/c++/10.0.1/type_traits:138:12:
  required from 'struct std::__and_<std::__not_<std::is_void<A> >,
std::filesystem::__cxx11::__detail::__constructible_from<A, void> >'

/opt/compiler-explorer/gcc-trunk-20200321/include/c++/10.0.1/type_traits:143:12:
  required from 'struct std::__and_<std::__not_<std::is_same<A,
std::filesystem::__cxx11::path> >, std::__not_<std::is_void<A> >,
std::filesystem::__cxx11::__detail::__constructible_from<A, void> >'

/opt/compiler-explorer/gcc-trunk-20200321/include/c++/10.0.1/bits/fs_path.h:119:11:
  required by substitution of 'template<class _Tp1, class _Tp2> using _Path =
typename std::enable_if<std::__and_<std::__not_<std::is_same<typename
std::remove_cv< <template-parameter-1-1> >::type,
std::filesystem::__cxx11::path> >, std::__not_<std::is_void<typename
std::remove_pointer<_Tp>::type> >,
std::filesystem::__cxx11::__detail::__constructible_from<_Tp1, _Tp2> >::value,
std::filesystem::__cxx11::path>::type [with _Tp1 = A; _Tp2 = void]'

/opt/compiler-explorer/gcc-trunk-20200321/include/c++/10.0.1/bits/fs_path.h:219:7:
  required by substitution of 'template<class _Source, class _Require>
std::filesystem::__cxx11::path::path(const _Source&,
std::filesystem::__cxx11::path::format) [with _Source = A; _Require =
<missing>]'

/opt/compiler-explorer/gcc-trunk-20200321/include/c++/10.0.1/type_traits:901:30:
  required from 'struct std::__is_constructible_impl<A, A>'

/opt/compiler-explorer/gcc-trunk-20200321/include/c++/10.0.1/type_traits:906:12:
  required from 'struct std::is_constructible<A, A>'

/opt/compiler-explorer/gcc-trunk-20200321/include/c++/10.0.1/type_traits:3091:25:
  required from 'constexpr const bool std::is_constructible_v<A, A>'

/opt/compiler-explorer/gcc-trunk-20200321/include/c++/10.0.1/concepts:139:30:  
required from here

/opt/compiler-explorer/gcc-trunk-20200321/include/c++/10.0.1/concepts:139:30:
error: the value of 'std::is_constructible_v<A, A>' is not usable in a constant
expression

  139 |       = destructible<_Tp> && is_constructible_v<_Tp, _Args...>;

      |                              ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

In file included from
/opt/compiler-explorer/gcc-trunk-20200321/include/c++/10.0.1/bits/move.h:57,

                 from
/opt/compiler-explorer/gcc-trunk-20200321/include/c++/10.0.1/bits/nested_exception.h:40,

                 from
/opt/compiler-explorer/gcc-trunk-20200321/include/c++/10.0.1/exception:148,

                 from
/opt/compiler-explorer/gcc-trunk-20200321/include/c++/10.0.1/stdexcept:38,

                 from
/opt/compiler-explorer/gcc-trunk-20200321/include/c++/10.0.1/system_error:41,

                 from
/opt/compiler-explorer/gcc-trunk-20200321/include/c++/10.0.1/bits/fs_fwd.h:35,

                 from
/opt/compiler-explorer/gcc-trunk-20200321/include/c++/10.0.1/filesystem:44,

                 from <source>:1:

/opt/compiler-explorer/gcc-trunk-20200321/include/c++/10.0.1/type_traits:3091:25:
note: 'std::is_constructible_v<A, A>' used in its own initializer

 3091 |   inline constexpr bool is_constructible_v =

      |                         ^~~~~~~~~~~~~~~~~~

ASM generation compiler returned: 1

In file included from
/opt/compiler-explorer/gcc-trunk-20200321/include/c++/10.0.1/compare:39,

                 from
/opt/compiler-explorer/gcc-trunk-20200321/include/c++/10.0.1/bits/stl_pair.h:65,

                 from
/opt/compiler-explorer/gcc-trunk-20200321/include/c++/10.0.1/bits/stl_algobase.h:64,

                 from
/opt/compiler-explorer/gcc-trunk-20200321/include/c++/10.0.1/bits/char_traits.h:39,

                 from
/opt/compiler-explorer/gcc-trunk-20200321/include/c++/10.0.1/string:40,

                 from
/opt/compiler-explorer/gcc-trunk-20200321/include/c++/10.0.1/stdexcept:39,

                 from
/opt/compiler-explorer/gcc-trunk-20200321/include/c++/10.0.1/system_error:41,

                 from
/opt/compiler-explorer/gcc-trunk-20200321/include/c++/10.0.1/bits/fs_fwd.h:35,

                 from
/opt/compiler-explorer/gcc-trunk-20200321/include/c++/10.0.1/filesystem:44,

                 from <source>:1:

/opt/compiler-explorer/gcc-trunk-20200321/include/c++/10.0.1/bits/stl_iterator_base_types.h:
In instantiation of 'struct std::iterator_traits<A>':

/opt/compiler-explorer/gcc-trunk-20200321/include/c++/10.0.1/bits/fs_path.h:84:11:
  required by substitution of 'template<class _Iter, class _Iter_traits> using
__is_path_iter_src = std::__and_<std::__or_<std::is_same<typename
std::remove_const<typename _Iter_traits::value_type>::type, char>,
std::is_same<typename std::remove_const<typename
_Iter_traits::value_type>::type, char8_t>, std::is_same<typename
std::remove_const<typename _Iter_traits::value_type>::type, wchar_t>,
std::is_same<typename std::remove_const<typename
_Iter_traits::value_type>::type, char16_t>, std::is_same<typename
std::remove_const<typename _Iter_traits::value_type>::type, char32_t> >,
std::is_base_of<std::input_iterator_tag, typename
_Iter_traits::iterator_category> > [with _Iter = A; _Iter_traits =
std::iterator_traits<A>]'

/opt/compiler-explorer/gcc-trunk-20200321/include/c++/10.0.1/bits/fs_path.h:91:5:
  required by substitution of 'template<class _Iter>
std::filesystem::__cxx11::__detail::__is_path_iter_src<_Iter>
std::filesystem::__cxx11::__detail::__is_path_src(_Iter, int) [with _Iter = A]'

/opt/compiler-explorer/gcc-trunk-20200321/include/c++/10.0.1/bits/fs_path.h:115:29:
  required from 'struct
std::filesystem::__cxx11::__detail::__constructible_from<A, void>'

/opt/compiler-explorer/gcc-trunk-20200321/include/c++/10.0.1/type_traits:138:12:
  required from 'struct std::__and_<std::__not_<std::is_void<A> >,
std::filesystem::__cxx11::__detail::__constructible_from<A, void> >'

/opt/compiler-explorer/gcc-trunk-20200321/include/c++/10.0.1/type_traits:143:12:
  required from 'struct std::__and_<std::__not_<std::is_same<A,
std::filesystem::__cxx11::path> >, std::__not_<std::is_void<A> >,
std::filesystem::__cxx11::__detail::__constructible_from<A, void> >'

/opt/compiler-explorer/gcc-trunk-20200321/include/c++/10.0.1/bits/fs_path.h:119:11:
  required by substitution of 'template<class _Tp1, class _Tp2> using _Path =
typename std::enable_if<std::__and_<std::__not_<std::is_same<typename
std::remove_cv< <template-parameter-1-1> >::type,
std::filesystem::__cxx11::path> >, std::__not_<std::is_void<typename
std::remove_pointer<_Tp>::type> >,
std::filesystem::__cxx11::__detail::__constructible_from<_Tp1, _Tp2> >::value,
std::filesystem::__cxx11::path>::type [with _Tp1 = A; _Tp2 = void]'

/opt/compiler-explorer/gcc-trunk-20200321/include/c++/10.0.1/bits/fs_path.h:219:7:
  required by substitution of 'template<class _Source, class _Require>
std::filesystem::__cxx11::path::path(const _Source&,
std::filesystem::__cxx11::path::format) [with _Source = A; _Require =
<missing>]'

/opt/compiler-explorer/gcc-trunk-20200321/include/c++/10.0.1/type_traits:901:30:
  required from 'struct std::__is_constructible_impl<A, A>'

/opt/compiler-explorer/gcc-trunk-20200321/include/c++/10.0.1/type_traits:906:12:
  required from 'struct std::is_constructible<A, A>'

/opt/compiler-explorer/gcc-trunk-20200321/include/c++/10.0.1/type_traits:3091:25:
  required from 'constexpr const bool std::is_constructible_v<A, A>'

/opt/compiler-explorer/gcc-trunk-20200321/include/c++/10.0.1/concepts:139:30:  
required from here

/opt/compiler-explorer/gcc-trunk-20200321/include/c++/10.0.1/concepts:139:30:
error: the value of 'std::is_constructible_v<A, A>' is not usable in a constant
expression

  139 |       = destructible<_Tp> && is_constructible_v<_Tp, _Args...>;

      |                              ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

In file included from
/opt/compiler-explorer/gcc-trunk-20200321/include/c++/10.0.1/bits/move.h:57,

                 from
/opt/compiler-explorer/gcc-trunk-20200321/include/c++/10.0.1/bits/nested_exception.h:40,

                 from
/opt/compiler-explorer/gcc-trunk-20200321/include/c++/10.0.1/exception:148,

                 from
/opt/compiler-explorer/gcc-trunk-20200321/include/c++/10.0.1/stdexcept:38,

                 from
/opt/compiler-explorer/gcc-trunk-20200321/include/c++/10.0.1/system_error:41,

                 from
/opt/compiler-explorer/gcc-trunk-20200321/include/c++/10.0.1/bits/fs_fwd.h:35,

                 from
/opt/compiler-explorer/gcc-trunk-20200321/include/c++/10.0.1/filesystem:44,

                 from <source>:1:

/opt/compiler-explorer/gcc-trunk-20200321/include/c++/10.0.1/type_traits:3091:25:
note: 'std::is_constructible_v<A, A>' used in its own initializer

 3091 |   inline constexpr bool is_constructible_v =

      |                         ^~~~~~~~~~~~~~~~~~

Reply via email to