[Bug c++/95153] Arrays of 'const void *' should not be copyable in C++20

2022-03-11 Thread barry.revzin at gmail dot com via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=95153

Barry Revzin  changed:

   What|Removed |Added

 CC||barry.revzin at gmail dot com

--- Comment #5 from Barry Revzin  ---
Just to follow up, gcc trunk right now does this:

int main() {
int a[3]{};
void const* b[3](a);  // ok

void const* c[3]{};
void const* d[3](c);  // error: array must be initialized with a
brace-enclosed initializer
}

If 'd' is actually an error, then it's not because of that, so at the very
least, the diagnostic is wrong.

[Bug c++/95153] Arrays of 'const void *' should not be copyable in C++20

2020-07-06 Thread redi at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=95153

Jonathan Wakely  changed:

   What|Removed |Added

 Resolution|--- |INVALID
 Status|UNCONFIRMED |RESOLVED

--- Comment #4 from Jonathan Wakely  ---
Status -> RESOLVED INVALID

[Bug c++/95153] Arrays of 'const void *' should not be copyable in C++20

2020-07-06 Thread alisdairm at me dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=95153

--- Comment #3 from Alisdair Meredith  ---
Sorry, thought I had confirmed that I agree with the analysis above - this is a
(perhaps surprising) change to the specification of C++20.

What is the best way to withdraw this report as invalid?

[Bug c++/95153] Arrays of 'const void *' should not be copyable in C++20

2020-05-15 Thread rs2740 at gmail dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=95153

TC  changed:

   What|Removed |Added

 CC||rs2740 at gmail dot com

--- Comment #2 from TC  ---
This is behaving as specified.

const void* const a[10];
const void* const b[10](a);

is valid code in C++20; it initializes b[0] with [0] converted to a const
void*, and the rest of b with null pointers.

The void* case is

void* const a[10];
void* const b[10](a);

which is invalid because [0] is a void* const*; converting that to void* is
not allowed because it casts away constness.