If the default constructor works (and i see no reason why it shouldn't) I would just use that to avoid the issue entirely <br><div class="gmail_quote"><div dir="ltr">On Tue, Oct 18, 2016 at 12:21 PM Mehdi AMINI <<a href="mailto:mehdi.amini@apple.com">mehdi.amini@apple.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">mehdi_amini added inline comments.<br class="gmail_msg">
<br class="gmail_msg">
<br class="gmail_msg">
================<br class="gmail_msg">
Comment at: include/llvm/Support/CachePruning.h:64<br class="gmail_msg">
+  std::chrono::seconds Expiration{0};<br class="gmail_msg">
+  std::chrono::seconds Interval{0};<br class="gmail_msg">
   unsigned PercentageOfAvailableSpace = 0;<br class="gmail_msg">
----------------<br class="gmail_msg">
labath wrote:<br class="gmail_msg">
> mehdi_amini wrote:<br class="gmail_msg">
> > Why not `= 0` ?<br class="gmail_msg">
> > (<a href="http://llvm.org/docs/CodingStandards.html#do-not-use-braced-initializer-lists-to-call-a-constructor" rel="noreferrer" class="gmail_msg" target="_blank">http://llvm.org/docs/CodingStandards.html#do-not-use-braced-initializer-lists-to-call-a-constructor</a> )<br class="gmail_msg">
> `= 0` will not work, as duration objects are not implicitly constructible from integer types. I'd have to write `= std::chrono::seconds(0)`. After re-reading that section it's still not clear to me whether this is a permitted usage of brace-initialization. One could argue that duration is "constructed like an aggregate" (which contains only one member) and it does not do anything fancy.<br class="gmail_msg">
Also in the same document:<br class="gmail_msg">
<br class="gmail_msg">
```<br class="gmail_msg">
Default member initializers (non-static data member initializers): N2756<br class="gmail_msg">
Only use these for scalar members that would otherwise be left uninitialized. Non-scalar members generally have appropriate default constructors, and MSVC 2013 has problems when braced initializer lists are involved.<br class="gmail_msg">
``<br class="gmail_msg">
<br class="gmail_msg">
(We're removing the MSVC 2013 part right now, and still discussing the rule).<br class="gmail_msg">
<br class="gmail_msg">
I don't know what was the intent/motivation here, so I'm not sure what's the right thing to do.<br class="gmail_msg">
<br class="gmail_msg">
<br class="gmail_msg">
<a href="https://reviews.llvm.org/D25730" rel="noreferrer" class="gmail_msg" target="_blank">https://reviews.llvm.org/D25730</a><br class="gmail_msg">
<br class="gmail_msg">
<br class="gmail_msg">
<br class="gmail_msg">
</blockquote></div>