[libcxx-commits] [PATCH] D95821: [docs] Explain noexcept policy for narrow contracts.

Zoe Carver via Phabricator via libcxx-commits libcxx-commits at lists.llvm.org
Tue Feb 2 15:38:02 PST 2021

zoecarver added inline comments.

Comment at: libcxx/docs/UsingLibcxx.rst:355
+As of version 14 libc++ will mark functions that do not throw (i.e.,
+"Throws: nothing" as ``noexcept``). This means that functions will not
ldionne wrote:
> zoecarver wrote:
> > curdeius wrote:
> > > zoecarver wrote:
> > > > curdeius wrote:
> > > > > Why not 13?
> > > > Has the 13 release branch already been created? Even if it hasn't yet, almost all of the changes won't follow this "new" policy, so I think 14 makes more sense. 
> > > > 
> > > > If you'd still prefer I change it to 13, I'm happy to do that, though. 
> > > Release branch 12.x has been created a few days ago. So current main is version 13. It will be released in circa 6 months. I guess you thought it was one higher.
> > Ah, I see, yes, I did think it was one higher. 
> Instead of wording this as "libc++ *will* mark functions that do not throw as `noexcept`", I think we should instead say something like: It is acceptable to mark functions that do not throw as `noexcept`. That way, we say that we are allowed to do it and we may use that right, but we don't *have* to. As worded currently, it sounds like people could file bugs against us for not following our own design policy to the letter. Do you see the distinction?
Yes, I see the distinction, and I think you're right. 

I'd kind of like to say that going forward we *will* mark these functions as `noexcept`, but I understand that might not be a reasonable thing to do (or at least not reasonable to do right now).

I updated the text to use 'may'/'might' rather than 'will'.

  rG LLVM Github Monorepo



More information about the libcxx-commits mailing list