diff options
author | Francois Pichet <pichet2000@gmail.com> | 2011-01-18 05:04:39 +0000 |
---|---|---|
committer | Francois Pichet <pichet2000@gmail.com> | 2011-01-18 05:04:39 +0000 |
commit | 64225794119eed4ffa7adb6dfc6f0e92d516ad69 (patch) | |
tree | e26f5af3f8d8a8012acf5fcbcb6eb153059b7877 /clang/test/Parser/MicrosoftExtensions.cpp | |
parent | c8d55da05ac50214893b8a218048d5dbc756ce57 (diff) | |
download | bcm5719-llvm-64225794119eed4ffa7adb6dfc6f0e92d516ad69.tar.gz bcm5719-llvm-64225794119eed4ffa7adb6dfc6f0e92d516ad69.zip |
Add support for explicit constructor calls in Microsoft mode.
For example:
class A{
public:
A& operator=(const A& that) {
if (this != &that) {
this->A::~A();
this->A::A(that); // <=== explicit constructor call.
}
return *this;
}
};
More work will be needed to support an explicit call to a template constructor.
llvm-svn: 123735
Diffstat (limited to 'clang/test/Parser/MicrosoftExtensions.cpp')
-rw-r--r-- | clang/test/Parser/MicrosoftExtensions.cpp | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/clang/test/Parser/MicrosoftExtensions.cpp b/clang/test/Parser/MicrosoftExtensions.cpp index bc8e88d64bb..1d5811496a7 100644 --- a/clang/test/Parser/MicrosoftExtensions.cpp +++ b/clang/test/Parser/MicrosoftExtensions.cpp @@ -85,3 +85,21 @@ void template_uuid() __uuidof(T); __uuidof(expr); } + + + +class CtorCall { +public: + CtorCall& operator=(const CtorCall& that); + + int a; +}; + +CtorCall& CtorCall::operator=(const CtorCall& that) +{ + if (this != &that) { + this->CtorCall::~CtorCall(); + this->CtorCall::CtorCall(that); // expected-warning {{explicit constructor calls are a Microsoft extension}} + } + return *this; +} |