Re: question

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

 



On 21 July 2014 09:51, Graziano Servizi wrote:
> Is there an "undefined behaviour" in the following short code?
>
>
> //
> # include <iostream>
> # include <functional>
>
>  int main(  )
>  {
>   int c = 90;
>   double r = 70;
>   auto v = [c] (double c)
>    {std::cout << "homonymous dummy argument ... " << c << std::endl;};
>   v(r);
>  }
>
>
> //
>
> I ask this because the gnu-gcc compiler prints out the value of the
> "captured" int c = 90 variable, while clang prints the value of the double r
> = 70 transmitted argument instead...

It looks like a GCC bug, please report it to Bugzilla.




[Index of Archives]     [Linux C Programming]     [Linux Kernel]     [eCos]     [Fedora Development]     [Fedora Announce]     [Autoconf]     [The DWARVES Debugging Tools]     [Yosemite Campsites]     [Yosemite News]     [Linux GCC]

  Powered by Linux