On Mon, Jul 16, 2012 at 6:24 AM, Alexander Kornienko <span dir="ltr"><<a href="mailto:alexfh@google.com" target="_blank" class="cremed">alexfh@google.com</a>></span> wrote:<br><div class="gmail_extra"><div class="gmail_quote">
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div class="gmail_extra"><div class="gmail_quote"><div class="im">On Mon, Jul 16, 2012 at 3:10 PM, Chandler Carruth <span dir="ltr"><<a href="mailto:chandlerc@google.com" target="_blank" class="cremed">chandlerc@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>On Mon, Jul 16, 2012 at 6:02 AM, Alexander Kornienko <span dir="ltr"><<a href="mailto:alexfh@google.com" target="_blank" class="cremed">alexfh@google.com</a>></span> wrote:<br></div><div class="gmail_extra"><div class="gmail_quote">

<div>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div class="gmail_extra"><br><div class="gmail_quote"><div>On Fri, Jul 13, 2012 at 3:06 PM, Duncan Sands <span dir="ltr"><<a href="mailto:baldrick@free.fr" target="_blank" class="cremed">baldrick@free.fr</a>></span> wrote:<br>


<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
Hi Alexander,<br>
<div>> Initializers for some fields were missing in Option::Option<br>
<br>
</div>did it matter?  If so, please add a testcase.  If not, why this change?<br></blockquote></div><div>This did matter. It caused random crashes in case cl::opt was a member of non-POD class.</div></div></div></blockquote>


<div><br></div></div><div>Hold on, a *member*? 'cl::opt' objects are supposed to be globals, not members.</div></div></div></blockquote></div><div>We need it as a member to make a class which handles a common subset of command-line options for several clang tools. In a close future we'll need a control on which options should be enabled and which not. So we can't do it with global variables. Why can't we use it as a member?</div>
</div></div></blockquote><div><br></div><div>Errr... Ok, this is something we should discuss in more depth.</div><div><br></div><div>Essentially, it's not that you necessarily can't, it's that the library was never designed with that use case in mind. It's completely outside the contract of the library, and so random things are likely to continue breaking. If this the correct design, we need to at least extend the library with unittests to check its behavior in that context. These unittests would then be what you would run under Valgrind in order to detect the failure.<br>
</div></div></div>