[cfe-dev] (no subject)

Nikola Smiljanic popizdeh at gmail.com
Tue Aug 4 22:29:40 PDT 2015


What version of clang, I've just tried this with recent revision and it's
printing random values.

On Wed, Aug 5, 2015 at 3:36 AM, Anders Granlund <anders.granlund.0 at gmail.com
> wrote:

> It seems like this program always prints 0. I used the following command
> line:
>
> clang++ prog.cc -std=c++14 -pedantic-errors
>
>  It looks like clang does an unnecessary zero-initialization of x here.
> Why is that?
>
> #include <iostream>
> struct S { int x; S() { std::cout << x << std::endl; } };
> int main() { S s; }
>
>
> _______________________________________________
> cfe-dev mailing list
> cfe-dev at lists.llvm.org
> http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-dev
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/cfe-dev/attachments/20150805/af1e7b4f/attachment.html>


More information about the cfe-dev mailing list