[PATCH] D25730: Remove TimeValue usage from llvm/Support

Zachary Turner via llvm-commits llvm-commits at lists.llvm.org
Tue Oct 18 12:35:21 PDT 2016


If the default constructor works (and i see no reason why it shouldn't) I
would just use that to avoid the issue entirely
On Tue, Oct 18, 2016 at 12:21 PM Mehdi AMINI <mehdi.amini at apple.com> wrote:

> mehdi_amini added inline comments.
>
>
> ================
> Comment at: include/llvm/Support/CachePruning.h:64
> +  std::chrono::seconds Expiration{0};
> +  std::chrono::seconds Interval{0};
>    unsigned PercentageOfAvailableSpace = 0;
> ----------------
> labath wrote:
> > mehdi_amini wrote:
> > > Why not `= 0` ?
> > > (
> http://llvm.org/docs/CodingStandards.html#do-not-use-braced-initializer-lists-to-call-a-constructor
> )
> > `= 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.
> Also in the same document:
>
> ```
> Default member initializers (non-static data member initializers): N2756
> 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.
> ``
>
> (We're removing the MSVC 2013 part right now, and still discussing the
> rule).
>
> I don't know what was the intent/motivation here, so I'm not sure what's
> the right thing to do.
>
>
> https://reviews.llvm.org/D25730
>
>
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20161018/04e82f4c/attachment.html>


More information about the llvm-commits mailing list