[llvm-bugs] [Bug 15481] noexcept should check whether the expression is a constant expression

via llvm-bugs llvm-bugs at lists.llvm.org
Tue Nov 14 19:08:51 PST 2017


https://bugs.llvm.org/show_bug.cgi?id=15481

Richard Smith <richard-llvm at metafoo.co.uk> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
         Resolution|---                         |INVALID

--- Comment #5 from Richard Smith <richard-llvm at metafoo.co.uk> ---
Conclusion from CWG discussion: we're going to keep this as-is. "noexcept" has
no special rule for constant expressions.

It turns out this is actually essential for proper library functionality: eg,
if noexcept tries evaluating its operand, then (for example)
is_nothrow_swappable is broken by making std::swap constexpr, because
std::swap<T> then often ends up getting instantiated before T is complete.

As a result of that, I'm also going to consider this change as an effective DR
against C++11 and C++14... but I'm open to reconsidering if we see many user
complaints.

-- 
You are receiving this mail because:
You are on the CC list for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-bugs/attachments/20171115/227c495e/attachment.html>


More information about the llvm-bugs mailing list