Skip to content

zig c++: Doesn't support c++ modules #15496

Open
@kassane

Description

@kassane

LLVM 16 currently adds support for c++ modules to clang/++, in addition to clang modules.
However, zig cc/c++ does not have optimal support based on the references below.

Test

zig - version 0.11.0-dev.2868+1a455b2dd

# download fork
$> git clone https://github.com/kassane/fmt
$> cd fmt/
$> zig build # add -DTests to build all tests (default libfmt only)
$> zig cc -x c++ -std=c++2b -Iinclude test/module-test.cc -o module -lc++ -Lzig-out/lib -lfmt
test/module-test.cc:47:8: fatal error: module 'fmt' not found
import fmt;
~~~~~~~^~~
1 error generated.

$>  zig cc -x c++-module -std=c++2b -Iinclude test/module-test.cc -o module -lc++ -Lzig-out/lib -lfmt
error: language not recognized: 'c++-module'

cc: @Vexu => (please, add tag)

References

Metadata

Metadata

Assignees

No one assigned

    Labels

    contributor friendlyThis issue is limited in scope and/or knowledge of Zig internals.enhancementSolving this issue will likely involve adding new logic or components to the codebase.zig ccZig as a drop-in C compiler feature

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions