diff --git a/clang/lib/AST/ASTContext.cpp b/clang/lib/AST/ASTContext.cpp index 3a72c3d257944..de65c3cc47b9b 100644 --- a/clang/lib/AST/ASTContext.cpp +++ b/clang/lib/AST/ASTContext.cpp @@ -2859,10 +2859,8 @@ bool ASTContext::hasUniqueObjectRepresentations( if (Ty->isPointerType()) return true; - if (Ty->isMemberPointerType()) { - const auto *MPT = Ty->getAs(); + if (const auto *MPT = Ty->getAs()) return !ABI->getMemberPointerInfo(MPT).HasPadding; - } if (Ty->isRecordType()) { const RecordDecl *Record = Ty->castAs()->getDecl();