and deserialize as a CallExpr which is close, but ends up
deserializing with the wrong stmt class.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@103371
91177308-0d34-0410-b5e6-
96231b3b80d8
/// the object argument).
class CXXMemberCallExpr : public CallExpr {
public:
- CXXMemberCallExpr(ASTContext& C, Expr *fn, Expr **args, unsigned numargs,
+ CXXMemberCallExpr(ASTContext &C, Expr *fn, Expr **args, unsigned numargs,
QualType t, SourceLocation rparenloc)
: CallExpr(C, CXXMemberCallExprClass, fn, args, numargs, t, rparenloc) {}
+ CXXMemberCallExpr(ASTContext &C, EmptyShell Empty)
+ : CallExpr(C, CXXMemberCallExprClass, Empty) { }
+
/// getImplicitObjectArgument - Retrieves the implicit object
/// argument for the member call. For example, in "x.f(5)", this
/// operation would return "x".
/// \brief A CXXOperatorCallExpr record.
EXPR_CXX_OPERATOR_CALL,
+ /// \brief A CXXMemberCallExpr record.
+ EXPR_CXX_MEMBER_CALL,
/// \brief A CXXConstructExpr record.
EXPR_CXX_CONSTRUCT,
// \brief A CXXStaticCastExpr record.
case pch::EXPR_CXX_OPERATOR_CALL:
S = new (Context) CXXOperatorCallExpr(*Context, Empty);
break;
+
+ case pch::EXPR_CXX_MEMBER_CALL:
+ S = new (Context) CXXMemberCallExpr(*Context, Empty);
+ break;
case pch::EXPR_CXX_CONSTRUCT:
S = new (Context) CXXConstructExpr(Empty, *Context,
// C++ Statements
void VisitCXXOperatorCallExpr(CXXOperatorCallExpr *E);
+ void VisitCXXMemberCallExpr(CXXMemberCallExpr *E);
void VisitCXXConstructExpr(CXXConstructExpr *E);
void VisitCXXNamedCastExpr(CXXNamedCastExpr *E);
void VisitCXXStaticCastExpr(CXXStaticCastExpr *E);
Code = pch::EXPR_CXX_OPERATOR_CALL;
}
+void PCHStmtWriter::VisitCXXMemberCallExpr(CXXMemberCallExpr *E) {
+ VisitCallExpr(E);
+ Code = pch::EXPR_CXX_MEMBER_CALL;
+}
+
void PCHStmtWriter::VisitCXXConstructExpr(CXXConstructExpr *E) {
VisitExpr(E);
Writer.AddDeclRef(E->getConstructor(), Record);
// CXXNullPtrLiteralExpr
typedef __typeof__(nullptr) cxx_null_ptr_result;
+
+void foo(Derived *P) {
+ // CXXMemberCallExpr
+ P->f();
+}
\ No newline at end of file