diff options
author | Sean Hunt <scshunt@csclub.uwaterloo.ca> | 2011-05-26 01:26:05 +0000 |
---|---|---|
committer | Sean Hunt <scshunt@csclub.uwaterloo.ca> | 2011-05-26 01:26:05 +0000 |
commit | 9ae60d54e4454192384933f3020968ea5c8c3540 (patch) | |
tree | d3d6586a29f4941a1cd64d2a69fbe18e6b43f84e /test/SemaCXX/copy-constructor-error.cpp | |
parent | 55d484802f3e27930317739efc5f5956b78aac25 (diff) |
Implement a new warning for when adding a default argument to a method
makes it into a special member function. This is very bad and can lead
to all sorts of nastiness including implicit member functions violating
the One Definition Rule. This should probably be made ill-formed in a
later version of the standard, but for now we'll just warn.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@132104 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test/SemaCXX/copy-constructor-error.cpp')
-rw-r--r-- | test/SemaCXX/copy-constructor-error.cpp | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/test/SemaCXX/copy-constructor-error.cpp b/test/SemaCXX/copy-constructor-error.cpp index 9809bfc84b..64a7d58e19 100644 --- a/test/SemaCXX/copy-constructor-error.cpp +++ b/test/SemaCXX/copy-constructor-error.cpp @@ -13,10 +13,10 @@ void g() { namespace PR6064 { struct A { A() { } - inline A(A&, int); + inline A(A&, int); // expected-note {{was not a special member function}} }; - A::A(A&, int = 0) { } + A::A(A&, int = 0) { } // expected-warning {{makes this constructor a copy constructor}} void f() { A const a; |