Re: Bug with GCC's handling of lifetimes of implicit-lifetime types

2022-12-12 Thread Jonathan Wakely via Gcc
On Sun, 11 Dec 2022 at 13:44, Gavin Ray wrote: > > Whoops, the last line should be pages_span(storage, ...) That won't even compile, so there's your main difference. That seems even more off-topic on this list than "somebody told me gcc is broken, because of [unrelated code example with UB]". A

Re: Bug with GCC's handling of lifetimes of implicit-lifetime types

2022-12-11 Thread Gavin Ray via Gcc
Whoops, the last line should be pages_span(storage, ...) On Sun, Dec 11, 2022 at 8:38 AM Gavin Ray wrote: > @Richard > > That's some intense code, I appreciate the code-samples and explanation, > thank you =) > > @Jonathan > > Maybe there was some misunderstanding? > I didn't make the connection

Re: Bug with GCC's handling of lifetimes of implicit-lifetime types

2022-12-11 Thread Gavin Ray via Gcc
@Richard That's some intense code, I appreciate the code-samples and explanation, thank you =) @Jonathan Maybe there was some misunderstanding? I didn't make the connection either but I also don't know that much about C++ It seems like that expression is valid then? Good to know =) As a random

Re: Bug with GCC's handling of lifetimes of implicit-lifetime types

2022-12-11 Thread Richard Biener via Gcc
On Sun, Dec 11, 2022 at 1:02 PM Jonathan Wakely wrote: > > > > On Sun, 11 Dec 2022, 09:12 Richard Biener, wrote: >> >> On Sat, Dec 10, 2022 at 7:45 PM Andrew Pinski via Gcc >> wrote: >> > >> > On Sat, Dec 10, 2022 at 10:36 AM Jonathan Wakely via Gcc >> > wrote: >> > > >> > > On Sat, 10 Dec 202

Re: Bug with GCC's handling of lifetimes of implicit-lifetime types

2022-12-11 Thread Jonathan Wakely via Gcc
On Sun, 11 Dec 2022, 09:12 Richard Biener, wrote: > On Sat, Dec 10, 2022 at 7:45 PM Andrew Pinski via Gcc > wrote: > > > > On Sat, Dec 10, 2022 at 10:36 AM Jonathan Wakely via Gcc > > wrote: > > > > > > On Sat, 10 Dec 2022 at 17:42, Gavin Ray via Gcc > wrote: > > > > > > > > This came up when

Re: Bug with GCC's handling of lifetimes of implicit-lifetime types

2022-12-11 Thread Richard Biener via Gcc
On Sat, Dec 10, 2022 at 7:45 PM Andrew Pinski via Gcc wrote: > > On Sat, Dec 10, 2022 at 10:36 AM Jonathan Wakely via Gcc > wrote: > > > > On Sat, 10 Dec 2022 at 17:42, Gavin Ray via Gcc wrote: > > > > > > This came up when I was asking around about what the proper way was to: > > > > > > - Allo

Re: Bug with GCC's handling of lifetimes of implicit-lifetime types

2022-12-10 Thread Gavin Ray via Gcc
Ahh alright, thanks Jonathan & Andrew, appreciate the replies @Jonathan > ... "Without a proper implementation of start_lifetime_as (which GCC doesn't provide yet)" I mailed the author of that proposal yesterday after learning about it (it's very useful!) and they told me as much Had written them

Re: Bug with GCC's handling of lifetimes of implicit-lifetime types

2022-12-10 Thread Andrew Pinski via Gcc
On Sat, Dec 10, 2022 at 10:36 AM Jonathan Wakely via Gcc wrote: > > On Sat, 10 Dec 2022 at 17:42, Gavin Ray via Gcc wrote: > > > > This came up when I was asking around about what the proper way was to: > > > > - Allocate aligned storage for a buffer pool/page cache > > - Then create pointers to

Re: Bug with GCC's handling of lifetimes of implicit-lifetime types

2022-12-10 Thread Jonathan Wakely via Gcc
On Sat, 10 Dec 2022 at 17:42, Gavin Ray via Gcc wrote: > > This came up when I was asking around about what the proper way was to: > > - Allocate aligned storage for a buffer pool/page cache > - Then create pointers to "Page" structs inside of the storage memory area > > I thought something like t