SlaterLatiao marked 6 inline comments as done. SlaterLatiao added inline comments.
================ Comment at: clang/lib/Sema/SemaExprMember.cpp:523-524 + auto *TD = TST->getTemplateName().getAsTemplateDecl(); + assert(isa<ClassTemplateDecl>(TD) && + "template decl in member access is not ClassTemplateDecl"); + for (FieldDecl *Field : ---------------- dblaikie wrote: > No need for the assert if you're immediately going to `cast` anyway, it'll > assert. Though perhaps the custom assert here gives you a chance to make it > more explicit that this is intentional. Removed the assert. ================ Comment at: clang/lib/Sema/SemaExprMember.cpp:525-527 + for (FieldDecl *Field : + cast<ClassTemplateDecl>(TD)->getTemplatedDecl()->fields()) { + if (Field->getDeclName() == NameInfo.getName()) { ---------------- dblaikie wrote: > This could be `llvm::find_if`, maybe? Not sure if it'd be tidier, but maybe > more legible Rewrote with `llvm::find_if`. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D158006/new/ https://reviews.llvm.org/D158006 _______________________________________________ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits