This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [PATCH] Optimize n + 1 for automatic n array (PR c++/71537)
- From: Jakub Jelinek <jakub at redhat dot com>
- To: John Tytgat <John dot Tytgat at aaug dot net>
- Cc: Richard Biener <rguenther at suse dot de>, Jason Merrill <jason at redhat dot com>, gcc-patches at gcc dot gnu dot org
- Date: Wed, 11 Jan 2017 22:39:38 +0100
- Subject: Re: [PATCH] Optimize n + 1 for automatic n array (PR c++/71537)
- Authentication-results: sourceware.org; auth=none
- References: <20170110224033.GC21933@tucnak> <db9eb615-9f8d-ccd6-8360-de30f1a7cdc1@aaug.net>
- Reply-to: Jakub Jelinek <jakub at redhat dot com>
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