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 | dbee3411a22b0dbb03267f5445f7b796104991bb (patch) | |
tree | aa3c7e4cf0f0f5e7f1e4617715e10efbf1cfaa9d /test/Parser/MicrosoftExtensions.cpp | |
parent | 4dccb90e92ba9e4abffe0177493b6db9949678dd (diff) |
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.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@123735 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test/Parser/MicrosoftExtensions.cpp')
-rw-r--r-- | test/Parser/MicrosoftExtensions.cpp | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/test/Parser/MicrosoftExtensions.cpp b/test/Parser/MicrosoftExtensions.cpp index bc8e88d64b..1d5811496a 100644 --- a/test/Parser/MicrosoftExtensions.cpp +++ b/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; +} |