Skip to content

[BUG] short function body syntax generates bad code for named functions #257

Description

@filipsajdak

The current implementation of the cppfront compiles the following code:

f    :(x) = x + 2;
l := :(x) = x + 2;

to

auto f(auto const& x) -> void { x + 2; } // notice missing return
auto l {[](auto const& x) { return x + 2; }}; 

Expectation

I expect that the named and unnamed function defined with short function body syntax generates the same code that uses implicit return.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions