rsmith added inline comments. ================ Comment at: lib/Sema/SemaInit.cpp:5991-6001 @@ -5990,1 +5990,13 @@ + // If we're returning a function parameter, copy elision + // is not possible. + if (const FunctionDecl *FD = + dyn_cast_or_null<FunctionDecl>(VD->getParentFunctionOrMethod())) { + for (const auto *Param : FD->params()) { + if (Param == VD) { + DiagID = diag::warn_redundant_move_on_return; + break; + } + } + } + ---------------- Can you just check `isa<ParmVarDecl>(VD)`?
Repository: rL LLVM http://reviews.llvm.org/D11305 _______________________________________________ cfe-commits mailing list cfe-commits@cs.uiuc.edu http://lists.cs.uiuc.edu/mailman/listinfo/cfe-commits