octave-maintainers
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: error with d28016d16e9a (change to jsonencode.cc)


From: Carlo De Falco
Subject: Re: error with d28016d16e9a (change to jsonencode.cc)
Date: Thu, 1 Oct 2020 17:41:23 +0000


> Il giorno 1 ott 2020, alle ore 19:24, Rik <rik@octave.org> ha scritto:
> 
> In one sense, this is easy to resolve.  Instead of using the keyword "auto" 
> just specify the exact type of the underlying variable.  However, the 
> compiler really should be able to handle this construct.  Could you try 'g++ 
> --version'?  And is it really GNU g++ or is this a soft link to clang?

Isn't this a C++14 feature?

the following simple example compiles for me with std=c++14 or std=c++17 but 
fails with std=c++11 or std=gnu++11 :

int main ()
{
  auto f = [] (auto x) { return x + 1; };
  f (1.0);
}


$ clang++ -std=gnu++11 pippo.cc -o pippo
pippo.cc:3:16: error: 'auto' not allowed in lambda parameter
  auto f = [] (auto x) { return x + 1; };
               ^~~~
1 error generated.

> --Rik

c.


reply via email to

[Prev in Thread] Current Thread [Next in Thread]