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/lib/Sema/SemaExpr.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/lib/Sema/SemaExpr.cpp')
| -rw-r--r-- | clang/lib/Sema/SemaExpr.cpp | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/clang/lib/Sema/SemaExpr.cpp b/clang/lib/Sema/SemaExpr.cpp index 26fdb2e059c..45e0c3377b8 100644 --- a/clang/lib/Sema/SemaExpr.cpp +++ b/clang/lib/Sema/SemaExpr.cpp @@ -3902,6 +3902,12 @@ ExprResult Sema::ActOnMemberAccessExpr(Scope *S, Expr *Base, if (SS.isSet() && SS.isInvalid()) return ExprError(); + // Warn about the explicit constructor calls Microsoft extension. + if (getLangOptions().Microsoft && + Id.getKind() == UnqualifiedId::IK_ConstructorName) + Diag(Id.getSourceRange().getBegin(), + diag::ext_ms_explicit_constructor_call); + TemplateArgumentListInfo TemplateArgsBuffer; // Decompose the name into its component parts. |

