Skip to content

Commit 0b4a403

Browse files
committed
[FOLD] don't use getAsRecordDecl
1 parent 29282d2 commit 0b4a403

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

clang/lib/Sema/SemaExprCXX.cpp

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7980,7 +7980,8 @@ ExprResult Sema::ActOnStartCXXMemberReference(Scope *S, Expr *Base,
79807980
SmallVector<FunctionDecl*, 8> OperatorArrows;
79817981
CTypes.insert(Context.getCanonicalType(BaseType));
79827982

7983-
while (BaseType->getAsRecordDecl()) {
7983+
while (
7984+
isa<InjectedClassNameType, RecordType>(BaseType.getCanonicalType())) {
79847985
if (OperatorArrows.size() >= getLangOpts().ArrowDepth) {
79857986
Diag(OpLoc, diag::err_operator_arrow_depth_exceeded)
79867987
<< StartingType << getLangOpts().ArrowDepth << Base->getSourceRange();
@@ -8067,7 +8068,7 @@ ExprResult Sema::ActOnStartCXXMemberReference(Scope *S, Expr *Base,
80678068
// it's legal for the type to be incomplete if this is a pseudo-destructor
80688069
// call. We'll do more incomplete-type checks later in the lookup process,
80698070
// so just skip this check for ObjC types.
8070-
if (!BaseType->getAsRecordDecl()) {
8071+
if (!isa<InjectedClassNameType, RecordType>(BaseType.getCanonicalType())) {
80718072
ObjectType = ParsedType::make(BaseType);
80728073
MayBePseudoDestructor = true;
80738074
return Base;

0 commit comments

Comments
 (0)