On Tue, Nov 27, 2012 at 8:10 PM, John McCall <[email protected]> wrote:
> On Nov 27, 2012, at 7:45 PM, Richard Smith <[email protected]> > wrote: > > Author: rsmith > > Date: Tue Nov 27 21:45:24 2012 > > New Revision: 168769 > > > > URL: http://llvm.org/viewvc/llvm-project?rev=168769&view=rev > > Log: > > C++ core issue 1344, PR10618: promote "addition of default argument > makes this > > a special member" diagnostic from warning to error, and fix the cases > where it > > produced diagnostics with incorrect wording. > > > > We don't support this as an extension, and we ban it even in C++98 mode. > This > > breaks too much (for instance, the ABI-specified calling convention for > a type > > can change if it acquires a copy constructor through the addition of a > default > > argument). > > 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. > > struct A { > int x; > A() = default; > A(int x); > }; > > A::A(int x = 7) : x(x) {} // error? 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.
_______________________________________________ cfe-commits mailing list [email protected] http://lists.cs.uiuc.edu/mailman/listinfo/cfe-commits
