[clang] [clang] Add new warning: not eliding copy on return (missed NRVO) (PR #139973)

Aaron Ballman via cfe-commits cfe-commits at lists.llvm.org
Thu May 15 05:02:46 PDT 2025


AaronBallman wrote:

> Thanks!
> 
> You should make sure to include a release note before merging.
> 
> Also, perhaps these should be remarks instead of warnings. Seems like a better fit to me, it would be similar to remarks we provide about function inlining. Did you consider that?
> 
> FYI @AaronBallman

Remarks are used when there's something to report but it's not about the code being dubious. NRVO issues straddle the line between dubious code and not dubious code (code could rely on NRVO for correctness). But because GCC already has `-Wnrvo` and this aims to match their behavior, I think going with the warning flag makes more sense.

https://github.com/llvm/llvm-project/pull/139973


More information about the cfe-commits mailing list