tzik added inline comments.
================ Comment at: lib/Sema/Scope.cpp:122-123 +void Scope::setNRVOCandidate(VarDecl *Candidate) { + for (auto* D : DeclsInScope) { + VarDecl* VD = dyn_cast_or_null<VarDecl>(D); + if (VD && VD != Candidate && VD->isNRVOCandidate()) ---------------- rsmith wrote: > `*` on the right, please. Also `auto` -> `Decl` would be clearer and no > longer. Is `dyn_cast_or_null` really necessary? (Can `DeclsInScope` contain > `nullptr`?) I would expect that just `dyn_cast` would suffice. Done! Right, contents in `DeclsInScope` should be non-null, and dyn_cast should work well. ================ Comment at: lib/Sema/SemaDecl.cpp:12619-12620 void Sema::computeNRVO(Stmt *Body, FunctionScopeInfo *Scope) { - ReturnStmt **Returns = Scope->Returns.data(); + for (ReturnStmt* Return : Scope->Returns) { + const VarDecl* Candidate = Return->getNRVOCandidate(); + if (!Candidate) ---------------- rsmith wrote: > `*` on the right, please. Done Repository: rC Clang https://reviews.llvm.org/D47067 _______________________________________________ cfe-commits mailing list cfe-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits