summaryrefslogtreecommitdiffstats
path: root/clang/test/SemaCXX/copy-constructor-error.cpp
diff options
context:
space:
mode:
authorAlexis Hunt <alercah@gmail.com>2011-05-26 01:26:05 +0000
committerAlexis Hunt <alercah@gmail.com>2011-05-26 01:26:05 +0000
commitd051b871609d8a071c2421f2d4168e3725ba2fcb (patch)
tree1443ed56a78d15378db75edc69b458fdf80ffe01 /clang/test/SemaCXX/copy-constructor-error.cpp
parent7fac79e255a90b2d029e8e918c7c64fb1cb23696 (diff)
downloadbcm5719-llvm-d051b871609d8a071c2421f2d4168e3725ba2fcb.tar.gz
bcm5719-llvm-d051b871609d8a071c2421f2d4168e3725ba2fcb.zip
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. llvm-svn: 132104
Diffstat (limited to 'clang/test/SemaCXX/copy-constructor-error.cpp')
-rw-r--r--clang/test/SemaCXX/copy-constructor-error.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/clang/test/SemaCXX/copy-constructor-error.cpp b/clang/test/SemaCXX/copy-constructor-error.cpp
index 9809bfc84bb..64a7d58e19e 100644
--- a/clang/test/SemaCXX/copy-constructor-error.cpp
+++ b/clang/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;
OpenPOWER on IntegriCloud