summaryrefslogtreecommitdiffstats
path: root/clang/test/Parser/MicrosoftExtensions.cpp
diff options
context:
space:
mode:
authorFrancois Pichet <pichet2000@gmail.com>2011-01-18 05:04:39 +0000
committerFrancois Pichet <pichet2000@gmail.com>2011-01-18 05:04:39 +0000
commit64225794119eed4ffa7adb6dfc6f0e92d516ad69 (patch)
treee26f5af3f8d8a8012acf5fcbcb6eb153059b7877 /clang/test/Parser/MicrosoftExtensions.cpp
parentc8d55da05ac50214893b8a218048d5dbc756ce57 (diff)
downloadbcm5719-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.cpp18
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;
+}
OpenPOWER on IntegriCloud