<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 - Function pointer conversion with noexcept fails (c++17)"
href="https://bugs.llvm.org/show_bug.cgi?id=39008">39008</a>
</td>
</tr>
<tr>
<th>Summary</th>
<td>Function pointer conversion with noexcept fails (c++17)
</td>
</tr>
<tr>
<th>Product</th>
<td>new-bugs
</td>
</tr>
<tr>
<th>Version</th>
<td>6.0
</td>
</tr>
<tr>
<th>Hardware</th>
<td>PC
</td>
</tr>
<tr>
<th>OS</th>
<td>Linux
</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>new bugs
</td>
</tr>
<tr>
<th>Assignee</th>
<td>unassignedbugs@nondot.org
</td>
</tr>
<tr>
<th>Reporter</th>
<td>kittingj@synopsys.com
</td>
</tr>
<tr>
<th>CC</th>
<td>llvm-bugs@lists.llvm.org
</td>
</tr></table>
<p>
<div>
<pre>Created <span class=""><a href="attachment.cgi?id=20894" name="attach_20894" title="repro source file">attachment 20894</a> <a href="attachment.cgi?id=20894&action=edit" title="repro source file">[details]</a></span>
repro source file
Given the code: (also in repro.cpp attachment):
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
void noexcept_function_pointer_is_converted_to_function_pointer1() {
void (*p)() noexcept;
void (**pp)() = &p;
}
class C{};
void
noexcept_member_function_pointer_is_converted_to_member_function_pointer1() {
void (C::*p)() noexcept;
void (C::**pp)() = &p;
}
struct S2 {
typedef void (C::*p)() noexcept;
operator p();
};
void
noexcept_member_function_pointer_is_converted_to_member_function_pointer2() {
void (C::*q)() = S2();
}
~~~~~~~~~~~~~~~~~~~~~~~~~~~~
gcc (7.1) accepts the source
$ g++ -c -std=c++17 repro.cpp (no errors)
clang (6.0) errors with
$ clang++ -c -std=c++17 repro.cpp
repro.cpp:3:13: error: cannot initialize a variable of type 'void (**)()' with
an rvalue of type 'void (**)() noexcept'
void (**pp)() = &p;
^ ~~
repro.cpp:10:16: error: cannot initialize a variable of type 'void (C::**)()'
with an rvalue of type 'void (C::**)() noexcept': different
exception specifications
void (C::**pp)() = &p;
^ ~~
2 errors generated.</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>