Skip to content

[clang-cl] Cannot compile a nested struct with member named std::string Name; #136608

Open
@Nemirtingas

Description

@Nemirtingas

Hi,

I encountered an issue where clang-cl and clang couldn't compile some code, I Attached reproductible source.
If I remove std::string name; from Struct2_t, it compiles, or you could place the std::string in a struct outside Struct1_t and it will also work.

You can compile this code using my docker image: nemirtingas/windowscross_vcpkg:msvc2022_14.40.33807_win10.0.18362.0_clang18, this issue is about clang 19 but I first discovered it in clang 18 and the issue seems to be the same.

main.zip

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions