Skip to content

[BUG] Trying to 'std::move' when using with std::cin a last use variable #609

Open
@soraphis

Description

@soraphis

Describe the bug
If the guaranteed last use of a variable is in a std::cin a compiler error is thrown, since the cppfront generated code tries to std::move the variable.

First I did not realize it was because of the guaranteed last use, and while it is kinda nonsensical to read into a variable without ever reading from it, it was kinda confusing to get the cpp compiler error, as that meant I'd had to look into the cpp file as the cpp2 file was kinda "fine".

To Reproduce
https://cpp2.godbolt.org/z/d9e4bKGKW

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions