[clang] [clang CodeGen] Restrict return statements nested in return statements. (PR #94282)

via cfe-commits cfe-commits at lists.llvm.org
Tue Jun 4 10:14:54 PDT 2024


higher-performance wrote:

If you want to just add an easy diagnosis for now, what I'd do is:

1. Change it to a warning
1. Also check that the expression is an aggregate-initialization of a `return` expression

This will still have false-positives, but at least it should catch both of our cases to warn people.

The ultimate fix should just be to disable RVO in cases that we can't prove it's OK.

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


More information about the cfe-commits mailing list