[PATCH] Optimize n + 1 for automatic n array (PR c++/71537)
Jakub Jelinek
jakub@redhat.com
Wed Jan 11 21:39:00 GMT 2017
On Wed, Jan 11, 2017 at 10:27:23PM +0100, John Tytgat wrote:
> On 01/10/2017 11:40 PM, Jakub Jelinek wrote:
> > +constexpr bool
> > +foo ()
> > +{
> > + constexpr int n[42] = { 1 };
> > + constexpr int o = n ? 1 : 0;
> > + constexpr int p = n + 1 ? 1 : 0;
> > + constexpr int q = "abc" + 1 ? 1 : 0;
> > + return p + p + q == 3;
> > +}
>
> Not o + p + q ?
Oops, fixed.
Jakub
More information about the Gcc-patches
mailing list