Skip to content

Dead std::stack/std::deque is not being eliminated #53268

@firewave

Description

@firewave

An unused std::stack object with the default std::deque backend is not being eliminated. This is also true for GCC - see https://godbolt.org/z/749EGxjx1.

If you change the backend to std::vector it will be completely eliminated in Clang even if you pushed data into it. GCC will only completely eliminate it if it doesn't contain any data - see https://godbolt.org/z/fsacae58z.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions