On Tue, Nov 27, 2012 at 8:10 PM, John McCall <span dir="ltr"><<a href="mailto:rjmccall@apple.com" target="_blank">rjmccall@apple.com</a>></span> wrote:<br><div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<div class="im">On Nov 27, 2012, at 7:45 PM, Richard Smith <<a href="mailto:richard-llvm@metafoo.co.uk">richard-llvm@metafoo.co.uk</a>> wrote:<br>
> Author: rsmith<br>
> Date: Tue Nov 27 21:45:24 2012<br>
> New Revision: 168769<br>
><br>
> URL: <a href="http://llvm.org/viewvc/llvm-project?rev=168769&view=rev" target="_blank">http://llvm.org/viewvc/llvm-project?rev=168769&view=rev</a><br>
> Log:<br>
> C++ core issue 1344, PR10618: promote "addition of default argument makes this<br>
> a special member" diagnostic from warning to error, and fix the cases where it<br>
> produced diagnostics with incorrect wording.<br>
><br>
> We don't support this as an extension, and we ban it even in C++98 mode. This<br>
> breaks too much (for instance, the ABI-specified calling convention for a type<br>
> can change if it acquires a copy constructor through the addition of a default<br>
> argument).<br>
<br>
</div>Is it an error to add a default argument when there's already a special member of that exact type (ignoring the now-defaulted parameters)?  e.g.<br>
<br>
  struct A {<br>
    int x;<br>
    A() = default;<br>
    A(int x);<br>
  };<br>
<br>
  A::A(int x = 7) : x(x) {} // error?</blockquote><div><br></div><div>We don't have wording for the core issue yet (maybe you could poke Doug?). But yes, we diagnose any case where default arguments are added outside the class definition and they cause a member to become a special member, per the notes from the Bloomington CWG discussion.</div>
</div>