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
diff --git a/clang/test/Parser/MicrosoftExtensions.cpp b/clang/test/Parser/MicrosoftExtensions.cpp
index bc8e88d..1d58114 100644
--- a/clang/test/Parser/MicrosoftExtensions.cpp
+++ b/clang/test/Parser/MicrosoftExtensions.cpp
@@ -85,3 +85,21 @@
__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;
+}