On Tue, 2016-08-23 at 00:10 +0530, Prasad Ghangal wrote:
> On 22 August 2016 at 16:55, Trevor Saunders <tbsau...@tbsaunde.org>
> wrote:
> > On Sun, Aug 21, 2016 at 10:35:17PM +0530, Prasad Ghangal wrote:

[...]

> > @@ -228,6 +228,12 @@ struct GTY(()) function {
> >    /* GIMPLE body for this function.  */
> >    gimple_seq gimple_body;
> > 
> > +  /* GIMPLEFE pass to start with */
> > +  opt_pass *pass_startwith = NULL;
I'm guessing you've only compiled in C++11 mode? because I'm pretty
> > sure
> > you are using a C++11 feature here (the default member value you
> > assign).
> 

[...]

> I am not getting what did you mean by C++11 mode (I am not explicitly

Prasad: what compiler version are you using to build your patched gcc? 
 My guess is that you're using gcc 6 to build.

In gcc 6 we changed the default C++ mode from -std=gnu++98
to -std=gnu++14. See: 
  https://gcc.gnu.org/gcc-6/porting_to.html#gxx14

I believe the syntax that Trevor spotted is only available in C++11
onwards:

  $ cat test.cc
  struct foo
  {
    int field = 42;
  };

With the default for gcc 6:

  $ gcc -c test.cc -std=c++14

it has no problems, whereas with the default for gcc 5 and earlier:

  $ gcc -c test.cc -std=gnu++98
  test.cc:3:15: warning: non-static data member initializers only  
available with -std=c++11 or -std=gnu++11
   int field = 42;
               ^~

So it's probably worth attempting to bootstrap with an older gcc as the
starting compiler.

Hope this is helpful
Dave

Reply via email to