-
-
Notifications
You must be signed in to change notification settings - Fork 264
Incorrect return type of a function returning a pointer to an array #81
Copy link
Copy link
Closed
Labels
bugSomething isn't workingSomething isn't working
Description
See #74.
For this snippet
auto f(int i)
{ // also `decltype(auto) f(int i)`, `int(*f(int i))[3]` and `auto f(int i) -> int(*)[3]`
static int arr[5][3];
return &arr[i];
}Insights incorrectly outputs
int (*)[3] f(int i)
{
static int arr[5][3];
return &arr[i];
}and for this snippet
auto *f(int i)
{
static int arr[5][3];
return &arr[i];
}Insights incorrectly outputs
int *[3] f(int i)
{
static int arr[5][3];
return &arr[i];
}instead of the correct output for both snippets.
int(*f(int i))[3]
{
static int arr[5][3];
return &arr[i];
}Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
bugSomething isn't workingSomething isn't working