Skip to content

Macos 26 CI fails on ostream_iterator with -std=c++23 #206

@Dave-Allured

Description

@Dave-Allured

I am working on lttoolbox update for MacPorts. Current version lttoolbox 3.8.2 builds on macos 14 and 15 CI, but fails on macos 26 CI in acx.cc:
https://github.com/Dave-Allured/macports-ports/actions/runs/19790870027. The compiler is AppleClang 17.0.0. Flag -std=c++23 is included in the macos 26 build. Here is a very brief log excerpt. See full log file at above link for more details.

cd /opt/local/var/macports/build/lttoolbox-63ad2f6c/work/build/lttoolbox && /usr/bin/clang++ -DHAVE_GETOPT_LONG -DLTTOOLBOX_EXPORTS -DPACKAGE_VERSION=\"3.8.2\" -DSIZET_NOT_CSTDINT -D_GNU_SOURCE -D_POSIX_C_SOURCE=200112 -Dlttoolbox_EXPORTS -I/opt/local/include/libxml2 -I/opt/local/include/utf8cpp -I/opt/local/var/macports/build/lttoolbox-63ad2f6c/work/lttoolbox-3.8.2 -I/opt/local/var/macports/build/lttoolbox-63ad2f6c/work/lttoolbox-3.8.2/lttoolbox -pipe -Os -DNDEBUG -I/opt/local/include -stdlib=libc++ -isysroot/Library/Developer/CommandLineTools/SDKs/MacOSX26.sdk -Wall -Wextra -Wno-missing-field-initializers -Wno-deprecated -Wno-unused-parameter -fPIC -Wno-unused-result -flto -fvisibility-inlines-hidden -std=c++23 -arch arm64 -isysroot /Library/Developer/CommandLineTools/SDKs/MacOSX26.sdk -mmacosx-version-min=26.0 -fPIC -MD -MT lttoolbox/CMakeFiles/lttoolbox.dir/acx.cc.o -MF CMakeFiles/lttoolbox.dir/acx.cc.o.d -o CMakeFiles/lttoolbox.dir/acx.cc.o -c /opt/local/var/macports/build/lttoolbox-63ad2f6c/work/lttoolbox-3.8.2/lttoolbox/acx.cc
In file included from /opt/local/var/macports/build/lttoolbox-63ad2f6c/work/lttoolbox-3.8.2/lttoolbox/acx.cc:17:
In file included from /opt/local/var/macports/build/lttoolbox-63ad2f6c/work/lttoolbox-3.8.2/lttoolbox/acx.h:20:
In file included from /opt/local/var/macports/build/lttoolbox-63ad2f6c/work/lttoolbox-3.8.2/lttoolbox/sorted_vector.hpp:25:
In file included from /Library/Developer/CommandLineTools/SDKs/MacOSX26.sdk/usr/include/c++/v1/iterator:698:
/Library/Developer/CommandLineTools/SDKs/MacOSX26.sdk/usr/include/c++/v1/__iterator/ostream_iterator.h:62:20: error: invalid operands to binary expression ('ostream_type' (aka 'basic_ostream<char, std::char_traits<char>>') and 'const char')
     62 |     *__out_stream_ << __value;
        |     ~~~~~~~~~~~~~~ ^  ~~~~~~~

Github Copilot suggests:

  • Summary — why it fails on macOS 26 and not macOS 15
  • The compiler error originates from uses of operator<< / ostream_iterator in lttoolbox (acx.cc → sorted_vector.hpp → std::iterator headers). Newer Clang/libc++ shipped with macOS 26 has stricter overload resolution and/or different template/overload candidates than the toolchain on macOS 15. Code that relied on permissive implicit conversions (e.g. passing a char or a C-string where the ostream_iterator's value_type or the stream operator overloads expected a different type) now fails to compile.
  • In short: newer standard library + stricter overload resolution exposes a type mismatch when the code writes values/delimiters to an ostream via ostream_iterator. Older SDKs accepted it; the macOS 26 toolchain does not.

I do not understand C++ well enough to see the correct fix for this code. I will try downgrading the C++ standard to get this build to pass. Please let me know if a better fix is created.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions