<html>
<head>
<base href="https://bugs.llvm.org/">
</head>
<body><table border="1" cellspacing="0" cellpadding="8">
<tr>
<th>Bug ID</th>
<td><a class="bz_bug_link
bz_status_NEW "
title="NEW - std::is_nothrow_constructibe doesn't work well in case of std::optional<...>"
href="https://bugs.llvm.org/show_bug.cgi?id=39175">39175</a>
</td>
</tr>
<tr>
<th>Summary</th>
<td>std::is_nothrow_constructibe doesn't work well in case of std::optional<...>
</td>
</tr>
<tr>
<th>Product</th>
<td>libc++
</td>
</tr>
<tr>
<th>Version</th>
<td>7.0
</td>
</tr>
<tr>
<th>Hardware</th>
<td>PC
</td>
</tr>
<tr>
<th>OS</th>
<td>All
</td>
</tr>
<tr>
<th>Status</th>
<td>NEW
</td>
</tr>
<tr>
<th>Severity</th>
<td>normal
</td>
</tr>
<tr>
<th>Priority</th>
<td>P
</td>
</tr>
<tr>
<th>Component</th>
<td>All Bugs
</td>
</tr>
<tr>
<th>Assignee</th>
<td>unassignedclangbugs@nondot.org
</td>
</tr>
<tr>
<th>Reporter</th>
<td>mate.pek@gmail.com
</td>
</tr>
<tr>
<th>CC</th>
<td>llvm-bugs@lists.llvm.org, mclow.lists@gmail.com
</td>
</tr></table>
<p>
<div>
<pre>Hello,
The following code fails:
<span class="quote">>>></span >
#include <type_traits>
#include <optional>
struct FooThrow {
FooThrow() noexcept(true) {}
~FooThrow() noexcept(false) {} // <-- if true: OK
};
static_assert(noexcept(std::optional<FooThrow>()));
static_assert(noexcept(std::optional<FooThrow>(std::nullopt)));
static_assert(std::is_nothrow_constructible_v<std::optional<FooThrow>,
std::nullopt_t>);
static_assert(std::is_nothrow_constructible_v<std::optional<FooThrow>>);
<<<
(gcc compiles it)
I assume it is a library bug, because "noexcept(FooThrow())" is false with gcc
and clang too.
Best Regards,
Mate Pek</pre>
</div>
</p>
<hr>
<span>You are receiving this mail because:</span>
<ul>
<li>You are on the CC list for the bug.</li>
</ul>
</body>
</html>