@@ -7999,18 +7999,6 @@ ExprResult Sema::ActOnStartCXXMemberReference(Scope *S, Expr *Base,
79997999
80008000 QualType BaseType = Base->getType ();
80018001 MayBePseudoDestructor = false ;
8002- if (BaseType->isDependentType ()) {
8003- // If we have a pointer to a dependent type and are using the -> operator,
8004- // the object type is the type that the pointer points to. We might still
8005- // have enough information about that type to do something useful.
8006- if (OpKind == tok::arrow)
8007- if (const PointerType *Ptr = BaseType->getAs <PointerType>())
8008- BaseType = Ptr->getPointeeType ();
8009-
8010- ObjectType = ParsedType::make (BaseType);
8011- MayBePseudoDestructor = true ;
8012- return Base;
8013- }
80148002
80158003 // C++ [over.match.oper]p8:
80168004 // [...] When operator->returns, the operator-> is applied to the value
@@ -8025,7 +8013,7 @@ ExprResult Sema::ActOnStartCXXMemberReference(Scope *S, Expr *Base,
80258013 SmallVector<FunctionDecl*, 8 > OperatorArrows;
80268014 CTypes.insert (Context.getCanonicalType (BaseType));
80278015
8028- while (BaseType->isRecordType ()) {
8016+ while (BaseType->getAsRecordDecl ()) {
80298017 if (OperatorArrows.size () >= getLangOpts ().ArrowDepth ) {
80308018 Diag (OpLoc, diag::err_operator_arrow_depth_exceeded)
80318019 << StartingType << getLangOpts ().ArrowDepth << Base->getSourceRange ();
@@ -8036,7 +8024,7 @@ ExprResult Sema::ActOnStartCXXMemberReference(Scope *S, Expr *Base,
80368024 }
80378025
80388026 Result = BuildOverloadedArrowExpr (
8039- S, Base, OpLoc,
8027+ Base, OpLoc,
80408028 // When in a template specialization and on the first loop iteration,
80418029 // potentially give the default diagnostic (with the fixit in a
80428030 // separate note) instead of having the error reported back to here
@@ -8100,7 +8088,7 @@ ExprResult Sema::ActOnStartCXXMemberReference(Scope *S, Expr *Base,
81008088 // it's legal for the type to be incomplete if this is a pseudo-destructor
81018089 // call. We'll do more incomplete-type checks later in the lookup process,
81028090 // so just skip this check for ObjC types.
8103- if (!BaseType->isRecordType ()) {
8091+ if (BaseType-> isDependentType () || !BaseType->isRecordType ()) {
81048092 ObjectType = ParsedType::make (BaseType);
81058093 MayBePseudoDestructor = true ;
81068094 return Base;
@@ -8111,8 +8099,7 @@ ExprResult Sema::ActOnStartCXXMemberReference(Scope *S, Expr *Base,
81118099 // Unlike the object expression in other contexts, *this is not required to
81128100 // be of complete type for purposes of class member access (5.2.5) outside
81138101 // the member function body.
8114- if (!BaseType->isDependentType () &&
8115- !isThisOutsideMemberFunctionBody (BaseType) &&
8102+ if (!isThisOutsideMemberFunctionBody (BaseType) &&
81168103 RequireCompleteType (OpLoc, BaseType,
81178104 diag::err_incomplete_member_access)) {
81188105 return CreateRecoveryExpr (Base->getBeginLoc (), Base->getEndLoc (), {Base});
0 commit comments