diff options
Diffstat (limited to 'clang/test/SemaCXX/implicit-member-functions.cpp')
-rw-r--r-- | clang/test/SemaCXX/implicit-member-functions.cpp | 27 |
1 files changed, 27 insertions, 0 deletions
diff --git a/clang/test/SemaCXX/implicit-member-functions.cpp b/clang/test/SemaCXX/implicit-member-functions.cpp index 40a61e47fd3..2112188ae67 100644 --- a/clang/test/SemaCXX/implicit-member-functions.cpp +++ b/clang/test/SemaCXX/implicit-member-functions.cpp @@ -12,3 +12,30 @@ C& C::operator=(const C&) { return *this; } // expected-error {{definition of im struct D { }; // expected-note {{previous implicit declaration is here}} D::~D() { } // expected-error {{definition of implicitly declared destructor}} +// Make sure that the special member functions are introduced for +// name-lookup purposes and overload with user-declared +// constructors and assignment operators. +namespace PR6570 { + class A { }; + + class B { + public: + B() {} + + B(const A& a) { + operator = (CONST); + operator = (a); + } + + B& operator = (const A& a) { + return *this; + } + + void f(const A &a) { + B b(a); + }; + + static const B CONST; + }; + +} |