On Fri, 14 Feb 2025, 18:34 Andrew Pinski (QUIC),
wrote:
> > -Original Message-
> > From: Jonathan Wakely
> > Sent: Friday, February 14, 2025 6:49 AM
> > To: Andrew Pinski (QUIC)
> > Cc: gcc-patches@gcc.gnu.org; libstd...@gcc.gnu.org
> > Subject
> -Original Message-
> From: Jonathan Wakely
> Sent: Friday, February 14, 2025 6:49 AM
> To: Andrew Pinski (QUIC)
> Cc: gcc-patches@gcc.gnu.org; libstd...@gcc.gnu.org
> Subject: Re: [PATCH] libstc++: Improve list assumption after
> constructor [PR118865]
>
> O
On Fri, 14 Feb 2025 at 03:03, Andrew Pinski wrote:
>
> The code example here does:
> ```
> if (begin == end) __builtin_unreachable();
> std::list nl(begin, end);
>
> for (auto it = nl.begin(); it != nl.end(); it++)
> {
> ...
> }
> /* Remove the first element of the list. */
> nl.erase(nl.begin());
The code example here does:
```
if (begin == end) __builtin_unreachable();
std::list nl(begin, end);
for (auto it = nl.begin(); it != nl.end(); it++)
{
...
}
/* Remove the first element of the list. */
nl.erase(nl.begin());
```
And we get a warning because because we jump threaded the case were w