<div dir="ltr">Thanks! I updated the coding standards in r236244.</div><div class="gmail_extra"><br><div class="gmail_quote">On Tue, Apr 28, 2015 at 2:41 PM, Reid Kleckner <span dir="ltr"><<a href="mailto:rnk@google.com" target="_blank">rnk@google.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr">Default member initializers (or non-static data member initializers if you like) are these things:<div> struct Foo {</div><div> int x = -1;</div><div> int y = 0xdeadbeef;<br> };</div><div><br></div><div>I'd like to use them, because I'm tired of updating out-of-line constructors to explicitly initialize all scalar members. See for example CodeGenFunction():</div><div><a href="http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/CodeGen/CodeGenFunction.cpp?revision=235664&view=markup#l37" target="_blank">http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/CodeGen/CodeGenFunction.cpp?revision=235664&view=markup#l37</a></div><div><br></div><div>This feature is supported by MSVC 2013, Clang 3.0, and GCC 4.7, which together represent our platform support floor.</div><div><br></div><div>Any objections? If not, I'll update <a href="http://llvm.org/docs/CodingStandards.html" target="_blank">http://llvm.org/docs/CodingStandards.html</a> in a few days.</div><div><br></div><div>I'll also put in a word recommending that these should only be used to initialize scalars to constant values. C++ is very flexible and will let you put lots of stuff here, but doing so is probably bad form.</div></div>
</blockquote></div><br></div>