Skip to content

[clangd] clangd doesn't work with some file names with --experimental-modules-support option #148370

Open
@FSK-idk

Description

@FSK-idk

Here I have an example repo: https://github.com/FSK-idk/clangd-test

When I build the project and look at the file somefile.cppm in particular, I don't see any clangd info:

Image  

However, if I do one of the following, the info will come back:

  • comment import std; in the file types.cppm
  • rename the file somefile.cppm, for example, to asd.cppm (or to some other name, but there is a chance that clangd will not work with the new name either)
  • add a new file asd.cppm with the content export module asd; (same here, maybe some other name)
  • remove --experimental-modules-support option (but then module info won't be available, but at least highlight will work)

Here is what it looks like if I rename somefile.cppm to asd.cppm:

Image  

Versions

❯ clangd --version
clangd version 20.1.7
Features: linux
Platform: x86_64-pc-linux-gnu
❯ clang --version 
clang version 20.1.7
Target: x86_64-pc-linux-gnu
Thread model: posix
InstalledDir: /usr/bin

I also tested it with 21.0.0git version I built today and got the same result.

Metadata

Metadata

Assignees

No one assigned

    Labels

    clang:modulesC++20 modules and Clang Header Modulesclangd

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions