Skip to content

Incorrect type of a function returning a rvalue reference to a function or array #124

@languagelawyer

Description

@languagelawyer

This is similar to #74

int a[2];

int (&&f())[2]
{
  return static_cast<int(&&)[2]>(a);
}

is transformed to

int a[2];


int (&&)[2] f()
{
  return static_cast<int (&&)[2]>(a);
}

And

void g()
{
}

void (&&f())()
{
  return g;
}

into

void g()
{
}


void (&&)() f()
{
  return g;
}

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