Issue 172497
Summary [clang] Wrong location for libc++.modules.json
Labels clang, libc++
Assignees
Reporter glennvl
    When trying to use the std module in c++ I encountered an issue that the standard library modules json for libc++ is not found. I first thought it was an issue with cmake, but looking further I noticed that clang returns the wrong path when requesting the location of the libc++ standard library modules json file.

Actual (incorrect) output:

```console
user@28188bd9366e:/workspaces/cpp-devcontainer/test$ clang++ -print-file-name=libc++.modules.json 
/lib/x86_64-linux-gnu/libc++.modules.json
```

Expected (correct) output:

```console
user@28188bd9366e:/workspaces/cpp-devcontainer/test$ clang++ -print-file-name=libc++.modules.json 
/usr/lib/llvm-21/lib/libc++.modules.json
```

Note that when requesting the `libstdc++` modules json the correct location is returned

```console
user@28188bd9366e:/workspaces/cpp-devcontainer/test$ clang++ -print-file-name=libstdc++.modules.json
/usr/lib/gcc/x86_64-linux-gnu/15/libstdc++.modules.json
```

Clang version I am using:

```console
user@28188bd9366e:/workspaces/cpp-devcontainer/test$ clang --version
Debian clang version 21.1.8 (++20251210013135+4582a800c588-1~exp1~20251210013253.73)
Target: x86_64-pc-linux-gnu
Thread model: posix
InstalledDir: /usr/lib/llvm-21/bin
```
_______________________________________________
llvm-bugs mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-bugs

Reply via email to