Open
Description
Currently the fixit that transforms a local pointer initialized with constant size array uses 2-parameter std::span constructor to which it passes the array and it's size.
void local_variable_qualifiers_specifiers() {
int a[10];
...
// CHECK: fix-it:"{{.*}}":{[[@LINE-1]]:3-[[@LINE-1]]:18}:"std::span<int const> p"
// CHECK: fix-it:"{{.*}}":{[[@LINE-2]]:19-[[@LINE-2]]:19}:"{"
// CHECK: fix-it:"{{.*}}":{[[@LINE-3]]:20-[[@LINE-3]]:20}:", 10}"
Idiomatic fixit should not repeat the size and instead rely on single parameter std::span constructor that take const size array.
No. 4 here: https://en.cppreference.com/w/cpp/container/span/span
Example:
void foo() {
int foo[5];
std::span<int> sp = foo;
}