diff --git a/clang/lib/Sema/SemaExprMember.cpp b/clang/lib/Sema/SemaExprMember.cpp --- a/clang/lib/Sema/SemaExprMember.cpp +++ b/clang/lib/Sema/SemaExprMember.cpp @@ -611,11 +611,10 @@ if (Record->containsDecl(ND)) return true; - if (const CXXRecordDecl *RD = dyn_cast(Record)) { + if (const auto *RD = dyn_cast(Record)) { // Accept candidates that occur in any of the current class' base classes. for (const auto &BS : RD->bases()) { - if (const RecordType *BSTy = - dyn_cast_or_null(BS.getType().getTypePtrOrNull())) { + if (const auto *BSTy = BS.getType()->getAs()) { if (BSTy->getDecl()->containsDecl(ND)) return true; } diff --git a/clang/test/CXX/drs/dr1xx.cpp b/clang/test/CXX/drs/dr1xx.cpp --- a/clang/test/CXX/drs/dr1xx.cpp +++ b/clang/test/CXX/drs/dr1xx.cpp @@ -477,7 +477,7 @@ namespace dr141 { // dr141: yes template void f(); - template struct S { int n; }; + template struct S { int n; }; // expected-note {{'::dr141::S::n' declared here}} struct A : S { template void f(); template struct S {};