Index: cfe/trunk/lib/AST/ASTImporter.cpp =================================================================== --- cfe/trunk/lib/AST/ASTImporter.cpp +++ cfe/trunk/lib/AST/ASTImporter.cpp @@ -6089,9 +6089,13 @@ if (!ToMember && E->getMemberDecl()) return nullptr; - DeclAccessPair ToFoundDecl = DeclAccessPair::make( - dyn_cast(Importer.Import(E->getFoundDecl().getDecl())), - E->getFoundDecl().getAccess()); + auto *ToDecl = + dyn_cast_or_null(Importer.Import(E->getFoundDecl().getDecl())); + if (!ToDecl && E->getFoundDecl().getDecl()) + return nullptr; + + DeclAccessPair ToFoundDecl = + DeclAccessPair::make(ToDecl, E->getFoundDecl().getAccess()); DeclarationNameInfo ToMemberNameInfo( Importer.Import(E->getMemberNameInfo().getName()),