#clangd is has issues when module import is in a header file, and not the cpp file. This is not a problem for clang, its all in the same translation unit. AFAICT this is legal and fine C++20 module code, clangd shouldn't have this issue.
#clangd is has issues when module import is in a header file, and not the cpp file. This is not a problem for clang, its all in the same translation unit. AFAICT this is legal and fine C++20 module code, clangd shouldn't have this issue.
@hiddenalpha with brew it seems to come already with gcc. however, the bmi for the standard library is generated. I am as far as i got the last time when trying this. Import std worked then, when std.cc compiled together with my main.cpp but I couldn't figure out how to link the libstc++ then successfully.
Did anybody successfully use C++ import std; on a mac with G++-15 and cmake 4.2.3 ?
I got as far as a linker error missing std module init and am too much of a cmake newbie to figure out anything working.
RE: https://fosstodon.org/@glloyd/115966242032349737
And now I fixed it, just needs to be merged.
https://github.com/llvm/llvm-project/pull/178471
Found bug in clang-tidy with C++20 modules. A single check can conflict with itself.

File: CMakeLists.txt cmake_minimum_required(VERSION 3.28) project(clang_tidy_bug CXX) set(CMAKE_CXX_STANDARD 20) set(CMAKE_EXPORT_COMPILE_COMMANDS ON) add_library(mymodule) target_sources(mymodule ...
[EDIT: this is wrong, read thread]
Interesting #clangtidy issue.
When using #cppmodules its possible to have a fixit applies multiple times causing incorrect code.
I believe what is happening is the cppm is the source text, but its analysed in other translation unit by the module import which uses its pcm. In parallel they both read and apply their fixit and you get situations like NULL becoming nullptrptr.
I'll try and make a minimal example at some point.
Any diagnostic to find cyclic dependencies?
set(CMAKE_CXX_SCAN_FOR_MODULES ON)
add_library(A STATIC)
target_sources(A PUBLIC
FILE_SET CXX_MODULES FILES mod.cppm # export module x;
)
target_link_libraries(A PRIVATE B)
add_library(B STATIC use.cpp) # import x;
target_link_libraries(B PRIVATE A)
All you get ATM is failure at compile time `fatal error: module 'x' not found`
But it would be nice to know that the real issue is that A and B make a cycle
What is the reasonable way to test internal parts of a module?
For a complex module I want unit tests for parts that I do not want to export. Do I make an internals module that can be tested. Then have the actual module which only re-export what I intend to be the library's interface?
Working with #cpp20 #cppmodules with #ninjabuild and #cmake
How can I run just the scan/dynamic based bits so that I can run clang-tidy without a full build?
ATM I have this hack
```
# cmake config
cmake --preset thing
# select what I need made
ninja -C build -t inputs | grep -E '\.cppm\.o$|\.o\.modmap$' | xargs -r ninja -C build
# then I can run clang-tidy
```
There must be a better way
C++ modules support status across FLOSS libraries.
#cc
#cplusplus
#cplusplusprogramming
#modules
#ccmodules
#cppmodules