@@ -8101,7 +8101,7 @@ ExprResult Sema::ActOnStartCXXMemberReference(Scope *S, Expr *Base,
81018101 // it's legal for the type to be incomplete if this is a pseudo-destructor
81028102 // call. We'll do more incomplete-type checks later in the lookup process,
81038103 // so just skip this check for ObjC types.
8104- if (!isa<InjectedClassNameType, RecordType>( BaseType. getCanonicalType () )) {
8104+ if (BaseType-> isDependentType () || ! BaseType-> isRecordType ( )) {
81058105 ObjectType = ParsedType::make (BaseType);
81068106 MayBePseudoDestructor = true ;
81078107 return Base;
@@ -8112,17 +8112,12 @@ ExprResult Sema::ActOnStartCXXMemberReference(Scope *S, Expr *Base,
81128112 // Unlike the object expression in other contexts, *this is not required to
81138113 // be of complete type for purposes of class member access (5.2.5) outside
81148114 // the member function body.
8115- if (!BaseType->isDependentType () &&
8116- !isThisOutsideMemberFunctionBody (BaseType) &&
8115+ if (!isThisOutsideMemberFunctionBody (BaseType) &&
81178116 RequireCompleteType (OpLoc, BaseType,
81188117 diag::err_incomplete_member_access)) {
81198118 return CreateRecoveryExpr (Base->getBeginLoc (), Base->getEndLoc (), {Base});
81208119 }
81218120
8122- // We can't implicitly declare the destructor for a templated class.
8123- if (BaseType->isDependentType ())
8124- MayBePseudoDestructor = true ;
8125-
81268121 // C++ [basic.lookup.classref]p2:
81278122 // If the id-expression in a class member access (5.2.5) is an
81288123 // unqualified-id, and the type of the object expression is of a class
0 commit comments