Skip to content

std::visit produces duplicate code for identical branches #62648

@smeenai

Description

@smeenai

See https://godbolt.org/z/3436hhhz6 for an example, where we're generating identical copies of the deletion code for each variant type. https://godbolt.org/z/1c7PsGK4P shows that libstdc++ produces a single copy (with nothing else changed), so I assume this is something related to libc++'s implementation of variant and/or visit?

Metadata

Metadata

Assignees

No one assigned

    Labels

    clang:codegenIR generation bugs: mangling, exceptions, etc.libc++libc++ C++ Standard Library. Not GNU libstdc++. Not libc++abi.performance

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions