Skip to content

clang compilation failiure fix#4718

Open
mccakit wants to merge 1 commit intofmtlib:masterfrom
mccakit:master
Open

clang compilation failiure fix#4718
mccakit wants to merge 1 commit intofmtlib:masterfrom
mccakit:master

Conversation

@mccakit
Copy link

@mccakit mccakit commented Mar 18, 2026

No description provided.

@vitaut
Copy link
Contributor

vitaut commented Mar 18, 2026

Please provide more context including the full error and the repro command(s).

@mccakit
Copy link
Author

mccakit commented Mar 18, 2026

Module directives aren't allowed inside the preprocessor.

[3/4] Building CXX object CMakeFiles/fmt.dir/src/fmt.cc.o FAILED: [code=1] CMakeFiles/fmt.dir/src/fmt.cc.o CMakeFiles/fmt.dir/fmt.pcm /home/mccakit/dev/llvm/bin/clang++ -I/home/mccakit/desktop/fmt/include -std=c++26 -nostdinc++ -nostdlib++ -isystem /home/mccakit/dev/libcxx/native/include/c++/v1 -O3 -DNDEBUG -fPIC -fvisibility=hidden -fvisibility-inlines-hidden -MD -MT CMakeFiles/fmt.dir/src/fmt.cc.o -MF CMakeFiles/fmt.dir/src/fmt.cc.o.d @CMakeFiles/fmt.dir/src/fmt.cc.o.modmap -o CMakeFiles/fmt.dir/src/fmt.cc.o -c /home/mccakit/desktop/fmt/src/fmt.cc /home/mccakit/desktop/fmt/src/fmt.cc:139:1: error: module directive lines are not allowed on lines controlled by preprocessor conditionals 139 | module :private; | ^~~~~~~~~~~~~~~~ 1 error generated. ninja: build stopped: subcommand failed. mccakit@mccakit-asus:~/desktop/fmt$

If gcc specific behavior is still desired, it should be moved to a new file.

This clang 23 with libc++ + compiler-rt from the same llvm source tree

@vitaut
Copy link
Contributor

vitaut commented Mar 21, 2026

And what are the repro commands? Or, even better, do you have godbolt link?

@mccakit
Copy link
Author

mccakit commented Mar 22, 2026

Very well, I will give the repo commands, and will look into godbolt.

What format do you want them in?
I can copy paste my Conan package recipe here, or give exact bash commands in order.

@vitaut
Copy link
Contributor

vitaut commented Mar 23, 2026

Some self-contained form that only needs fmt checkout and standard build tooling (cmake and a C++ compiler), no conan. Bash commands are fine.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants