<html><head><meta http-equiv="Content-Type" content="text/html charset=us-ascii"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;" class=""><br class=""><div><blockquote type="cite" class=""><div class="">On Apr 28, 2015, at 2:41 PM, Reid Kleckner <<a href="mailto:rnk@google.com" class="">rnk@google.com</a>> wrote:</div><br class="Apple-interchange-newline"><div class=""><div dir="ltr" class="">Default member initializers (or non-static data member initializers if you like) are these things:<div class="">  struct Foo {</div><div class="">    int x = -1;</div><div class="">    int y = 0xdeadbeef;<br class="">  };</div><div class=""><br class=""></div><div class="">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 class=""><a href="http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/CodeGen/CodeGenFunction.cpp?revision=235664&view=markup#l37" class="">http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/CodeGen/CodeGenFunction.cpp?revision=235664&view=markup#l37</a></div><div class=""><br class=""></div><div class="">This feature is supported by MSVC 2013, Clang 3.0, and GCC 4.7, which together represent our platform support floor.</div><div class=""><br class=""></div><div class="">Any objections? If not, I'll update <a href="http://llvm.org/docs/CodingStandards.html" class="">http://llvm.org/docs/CodingStandards.html</a> in a few days.</div><div class=""><br class=""></div><div class="">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></div></blockquote><br class=""></div><div>SGTM.</div><div><br class=""></div><div>-Chris</div><div><br class=""></div><br class=""></body></html>