[clang] [C] Disable use of NRVO (PR #101038)

Richard Smith via cfe-commits cfe-commits at lists.llvm.org
Tue Jul 30 13:02:41 PDT 2024


zygoloid wrote:

I think `__attribute__((cleanup))` on a variable should disable NRVO on that variable, in both C and in C++. [GCC's behavior](https://godbolt.org/z/Psbbr83ET) is to ignore the `cleanup` attribute entirely if NRVO is applied to the variable, which seems like a flawed approach, but performing NRVO and doing something different also seems problematic, as demonstrated in #100868. Given that, I think that #100868 and #100902 should probably be handled independently.

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


More information about the cfe-commits mailing list