@@ -8101,7 +8101,7 @@ ExprResult Sema::ActOnStartCXXMemberReference(Scope *S, Expr *Base,
8101
8101
// it's legal for the type to be incomplete if this is a pseudo-destructor
8102
8102
// call. We'll do more incomplete-type checks later in the lookup process,
8103
8103
// so just skip this check for ObjC types.
8104
- if (!isa<InjectedClassNameType, RecordType>( BaseType. getCanonicalType () )) {
8104
+ if (BaseType-> isDependentType () || ! BaseType-> isRecordType ( )) {
8105
8105
ObjectType = ParsedType::make (BaseType);
8106
8106
MayBePseudoDestructor = true ;
8107
8107
return Base;
@@ -8112,17 +8112,12 @@ ExprResult Sema::ActOnStartCXXMemberReference(Scope *S, Expr *Base,
8112
8112
// Unlike the object expression in other contexts, *this is not required to
8113
8113
// be of complete type for purposes of class member access (5.2.5) outside
8114
8114
// the member function body.
8115
- if (!BaseType->isDependentType () &&
8116
- !isThisOutsideMemberFunctionBody (BaseType) &&
8115
+ if (!isThisOutsideMemberFunctionBody (BaseType) &&
8117
8116
RequireCompleteType (OpLoc, BaseType,
8118
8117
diag::err_incomplete_member_access)) {
8119
8118
return CreateRecoveryExpr (Base->getBeginLoc (), Base->getEndLoc (), {Base});
8120
8119
}
8121
8120
8122
- // We can't implicitly declare the destructor for a templated class.
8123
- if (BaseType->isDependentType ())
8124
- MayBePseudoDestructor = true ;
8125
-
8126
8121
// C++ [basic.lookup.classref]p2:
8127
8122
// If the id-expression in a class member access (5.2.5) is an
8128
8123
// unqualified-id, and the type of the object expression is of a class
0 commit comments