This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [PATCH] Optimize n + 1 for automatic n array (PR c++/71537)


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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]