Skip to content

Incorrect type of a function returning a reference to an array #74

@languagelawyer

Description

@languagelawyer

For the following code

int arr[5][3];

decltype(auto) f(int i)
{
    return arr[i];
}

Insight produces (array declaration is skipped)

int (&)[3] f(int i)
{
  return arr[i];
}

whilst it shall be

int (&f(int i))[3]
{
  return arr[i];
}

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