[cfe-dev] (no subject)

Anders Granlund anders.granlund.0 at gmail.com
Tue Aug 4 10:36:50 PDT 2015


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; }
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/cfe-dev/attachments/20150804/e307b62c/attachment.html>


More information about the cfe-dev mailing list