<div dir="ltr">I fixed this in r285779.<br></div><div class="gmail_extra"><br><div class="gmail_quote">On Sat, Oct 29, 2016 at 8:50 AM, Pavel A. Lebedev via cfe-dev <span dir="ltr"><<a href="mailto:cfe-dev@lists.llvm.org" target="_blank">cfe-dev@lists.llvm.org</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Hi.<br>
<br>
Since r284549 'DR1330: instantiate exception-specifications when "needed"'<br>
clang rejects the following:<br>
<br>
$ cat d.cpp<br>
<br>
struct S<br>
{<br>
~S();<br>
void f(const S& s = S());<br>
};<br>
S::~S() {}<br>
<br>
$ clang++ -std=c++1z -fno-exceptions -fsyntax-only d.cpp<br>
<br>
d.cpp:6:4: error: conflicting types for '~S'<br>
S::~S() {}<br>
^<br>
d.cpp:3:5: note: previous declaration is here<br>
~S();<br>
^<br>
1 error generated.<br>
<br>
The error message is confusing (can it be improved?), but it seems<br>
that clang considers the definition of destructor implicitly<br>
noexcept(false),<br>
unlike declaration, since adding explicit 'noexcept' to the definition<br>
makes this compile again.<br>
As expected, this example compiles without error for C++03/11/14,<br>
since the commit in question is tweaking C++17-only rules.<br>
Also, clang accepts it if -fno-exceptions is NOT specified, so this looks<br>
like a bug to me.<br>
This is the minimal test case I was able to produce - this error only<br>
triggers for out-of-class destructor definitions when the class tries<br>
to construct its own instances in member function default arguments.<br>
This example was reduced from Qt, which breaks due to this pretty much<br>
completely<br>
and uses a combination of -std=c++1z and -fno-exceptions in default<br>
configuration<br>
when supported.<br>
<br>
---<br>
Pavel A. Lebedev<br>
<br>
______________________________<wbr>_________________<br>
cfe-dev mailing list<br>
<a href="mailto:cfe-dev@lists.llvm.org">cfe-dev@lists.llvm.org</a><br>
<a href="http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-dev" rel="noreferrer" target="_blank">http://lists.llvm.org/cgi-bin/<wbr>mailman/listinfo/cfe-dev</a><br>
</blockquote></div><br></div>