summaryrefslogtreecommitdiffstats
path: root/clang/lib/Sema
diff options
context:
space:
mode:
Diffstat (limited to 'clang/lib/Sema')
-rw-r--r--clang/lib/Sema/SemaDeclCXX.cpp22
-rw-r--r--clang/lib/Sema/SemaExprCXX.cpp3
2 files changed, 10 insertions, 15 deletions
diff --git a/clang/lib/Sema/SemaDeclCXX.cpp b/clang/lib/Sema/SemaDeclCXX.cpp
index 33fc52b71dc..e4321f53ff0 100644
--- a/clang/lib/Sema/SemaDeclCXX.cpp
+++ b/clang/lib/Sema/SemaDeclCXX.cpp
@@ -46,7 +46,7 @@ namespace {
bool VisitExpr(Expr *Node);
bool VisitDeclRefExpr(DeclRefExpr *DRE);
- bool VisitPredefinedExpr(PredefinedExpr *PE);
+ bool VisitCXXThisExpr(CXXThisExpr *ThisE);
};
/// VisitExpr - Visit all of the children of this expression.
@@ -88,18 +88,14 @@ namespace {
return false;
}
- /// VisitPredefinedExpr - Visit a predefined expression, which could
- /// refer to "this".
- bool CheckDefaultArgumentVisitor::VisitPredefinedExpr(PredefinedExpr *PE) {
- if (PE->getIdentType() == PredefinedExpr::CXXThis) {
- // C++ [dcl.fct.default]p8:
- // The keyword this shall not be used in a default argument of a
- // member function.
- return S->Diag(PE->getSourceRange().getBegin(),
- diag::err_param_default_argument_references_this,
- PE->getSourceRange());
- }
- return false;
+ /// VisitCXXThisExpr - Visit a C++ "this" expression.
+ bool CheckDefaultArgumentVisitor::VisitCXXThisExpr(CXXThisExpr *ThisE) {
+ // C++ [dcl.fct.default]p8:
+ // The keyword this shall not be used in a default argument of a
+ // member function.
+ return S->Diag(ThisE->getSourceRange().getBegin(),
+ diag::err_param_default_argument_references_this,
+ ThisE->getSourceRange());
}
}
diff --git a/clang/lib/Sema/SemaExprCXX.cpp b/clang/lib/Sema/SemaExprCXX.cpp
index fde28529b71..d012473c25d 100644
--- a/clang/lib/Sema/SemaExprCXX.cpp
+++ b/clang/lib/Sema/SemaExprCXX.cpp
@@ -708,8 +708,7 @@ Action::ExprResult Sema::ActOnCXXThis(SourceLocation ThisLoc) {
if (CXXMethodDecl *MD = dyn_cast<CXXMethodDecl>(CurContext))
if (MD->isInstance())
- return new PredefinedExpr(ThisLoc, MD->getThisType(Context),
- PredefinedExpr::CXXThis);
+ return new CXXThisExpr(ThisLoc, MD->getThisType(Context));
return Diag(ThisLoc, diag::err_invalid_this_use);
}
OpenPOWER on IntegriCloud