As Richard notes in PR23819, if we're returning a function parameter, copy elision isn't possible.
Details
Details
- Reviewers
- rtrieu - rsmith 
- Commits
- rG584a56391418: Merging r242600: --------------------------------------------------------------…
 rG7842c3fceada: [Sema] Emit correct warning when copy-elision is not possible.
 rC242600: [Sema] Emit correct warning when copy-elision is not possible.
 rL242600: [Sema] Emit correct warning when copy-elision is not possible.
Diff Detail
Diff Detail
- Repository
- rL LLVM
Event Timeline
| lib/Sema/SemaInit.cpp | ||
|---|---|---|
| 5991–6001 ↗ | (On Diff #30019) | Can you just check isa<ParmVarDecl>(VD)? | 
| test/SemaCXX/warn-pessmizing-move.cpp | ||
|---|---|---|
| 158 ↗ | (On Diff #30031) | Do we have more macro tests that test cases where the warning is produced? If not, please change the tests to use a local variable. | 
| test/SemaCXX/warn-pessmizing-move.cpp | ||
|---|---|---|
| 158 ↗ | (On Diff #30031) | No, we do not. Therefore I changed as you recommended. Thanks for noticing and the review in general. |