idk icon indicating copy to clipboard operation
idk copied to clipboard

Build Failure on Linux (Arch) GCC C++23 C23

Open DanDucky opened this issue 5 months ago • 0 comments

I cannot get this repository to build on my system with gcc c++23 c23 (I also can't get it to build with any other configuration of standards under gcc). It builds correctly when I switch to clang, but I'm developing a library and I'd like it to work properly on all major compilers. I've made a minimum CMake script required to reproduce this:

cmake_minimum_required(VERSION 4.0)
project(CMakeTests)

set(CMAKE_CXX_STANDARD 23)
set(CMAKE_C_STANDARD 23)

add_executable(CMakeTests main.cpp)

include(FetchContent)

FetchContent_Declare(ztd.idk
        GIT_REPOSITORY https://github.com/soasis/idk.git
        GIT_TAG        main)

FetchContent_MakeAvailable(ztd.idk)
target_link_libraries(CMakeTests PRIVATE ztd::idk) 

I'm running with: CMake 4.0.3-dirty GCC 15.1.1 Ninja 1.12.1

The clang version I've tested which works is 20.1.8

The build error is as follows:

FAILED: _deps/ztd.idk-build/CMakeFiles/ztd.idk.dir/source/ztd/idk/encoding_detection.c.cpp.o
/usr/bin/g++ -DZTD_IDK_BUILD=1 -Ddl -I./build/_deps/ztd.idk-src/include -I./source/include -g -std=gnu++23 -fdiagnostics-color=always -MD -MT _deps/ztd.idk-build/CMakeFiles/ztd.idk.dir/source/ztd/idk/encoding_detection.c.cpp.o -MF _deps/ztd.idk-build/CMakeFiles/ztd.idk.dir/source/ztd/idk/encoding_detection.c.cpp.o.d -fmodules-ts -fmodule-mapper=_deps/ztd.idk-build/CMakeFiles/ztd.idk.dir/source/ztd/idk/encoding_detection.c.cpp.o.modmap -MD -fdeps-format=p1689r5 -x c++ -o _deps/ztd.idk-build/CMakeFiles/ztd.idk.dir/source/ztd/idk/encoding_detection.c.cpp.o -c ./build/_deps/ztd.idk-src/source/ztd/idk/encoding_detection.c.cpp
In file included from ./build/_deps/ztd.idk-src/include/ztd/ranges/algorithm.hpp:44,
                 from ./build/_deps/ztd.idk-src/include/ztd/idk/char_traits.hpp:41,
                 from ./build/_deps/ztd.idk-src/include/ztd/idk/encoding_name.hpp:39,
                 from ./build/_deps/ztd.idk-src/source/ztd/idk/encoding_detection.c.cpp:35:
./build/_deps/ztd.idk-src/include/ztd/ranges/counted_iterator.hpp:254:113: error: ‘const class ztd::ranges::__v0::__rng_detail::__counted_iterator<_It>’ has no member named ‘_M_it’ [-Wtemplate-body]
  254 |                                 const __counted_iterator& __it) noexcept(noexcept(::ztd::ranges::iter_move(__it._M_it))) {
      |                                                                                                                 ^~~~~
./build/_deps/ztd.idk-src/include/ztd/ranges/counted_iterator.hpp:261:69: error: ‘const class ztd::ranges::__v0::__rng_detail::__counted_iterator<_It>’ has no member named ‘_M_it’ [-Wtemplate-body]
  261 |                                 noexcept(::ztd::ranges::iter_swap(x._M_it, y._M_it))) {
      |                                                                     ^~~~~
[4/9] Building CXX object _deps/ztd.idk-build/CMakeFiles/ztd.idk.dir/source/ztd/idk/encoding_name.c.cpp.o
FAILED: _deps/ztd.idk-build/CMakeFiles/ztd.idk.dir/source/ztd/idk/encoding_name.c.cpp.o
/usr/bin/g++ -DZTD_IDK_BUILD=1 -Ddl -I./build/_deps/ztd.idk-src/include -I./source/include -g -std=gnu++23 -fdiagnostics-color=always -MD -MT _deps/ztd.idk-build/CMakeFiles/ztd.idk.dir/source/ztd/idk/encoding_name.c.cpp.o -MF _deps/ztd.idk-build/CMakeFiles/ztd.idk.dir/source/ztd/idk/encoding_name.c.cpp.o.d -fmodules-ts -fmodule-mapper=_deps/ztd.idk-build/CMakeFiles/ztd.idk.dir/source/ztd/idk/encoding_name.c.cpp.o.modmap -MD -fdeps-format=p1689r5 -x c++ -o _deps/ztd.idk-build/CMakeFiles/ztd.idk.dir/source/ztd/idk/encoding_name.c.cpp.o -c ./build/_deps/ztd.idk-src/source/ztd/idk/encoding_name.c.cpp
In file included from ./build/_deps/ztd.idk-src/include/ztd/ranges/algorithm.hpp:44,
                 from ./build/_deps/ztd.idk-src/include/ztd/idk/char_traits.hpp:41,
                 from ./build/_deps/ztd.idk-src/include/ztd/idk/encoding_name.hpp:39,
                 from ./build/_deps/ztd.idk-src/source/ztd/idk/encoding_name.c.cpp:34:
./build/_deps/ztd.idk-src/include/ztd/ranges/counted_iterator.hpp:254:113: error: ‘const class ztd::ranges::__v0::__rng_detail::__counted_iterator<_It>’ has no member named ‘_M_it’ [-Wtemplate-body]
  254 |                                 const __counted_iterator& __it) noexcept(noexcept(::ztd::ranges::iter_move(__it._M_it))) {
      |                                                                                                                 ^~~~~
./build/_deps/ztd.idk-src/include/ztd/ranges/counted_iterator.hpp:261:69: error: ‘const class ztd::ranges::__v0::__rng_detail::__counted_iterator<_It>’ has no member named ‘_M_it’ [-Wtemplate-body]
  261 |                                 noexcept(::ztd::ranges::iter_swap(x._M_it, y._M_it))) {
      |                                                                     ^~~~~

I originally encountered this bug in trying to use ztd.text, but tracked it to ztd.idk and figured I'd report it here. I'm not using ztd.idk as a standalone.

DanDucky avatar Jul 24 '25 21:07 DanDucky