Skip to content

Compilation errors in big5_hkscs.hpp and gbk_or_gb18030.hpp on macOS with Apple Clang #48

@captainurist

Description

@captainurist

Several compilation errors occur when using Big5 and GB18030 encodings on macOS with Apple Clang 17. The issues are:

  1. big5_hkscs.hpp: Misplaced parenthesis in std::addressof call and invalid constexpr lambda
  2. gbk_or_gb18030.hpp: Type mismatch in replacement_code_points() function

Minimal reproduction code:

#include <string>
#include <span>
#include <ztd/text.hpp>

int main() {
    std::string big5_input = "\xa4\xa4";  // Chinese character for "middle"
    std::span<const char> input(big5_input.data(), big5_input.size());

    // This fails to compile
    auto result = ztd::text::transcode(input, ztd::text::big5_hkscs, ztd::text::compat_utf8,
                                       ztd::text::replacement_handler);
    return 0;
}

My fix here: 23459c9

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