[clang] [Clang][Sema]: Allow copy constructor side effects (PR #81127)

Aaron Ballman via cfe-commits cfe-commits at lists.llvm.org
Thu Feb 29 11:41:27 PST 2024


AaronBallman wrote:

> @AaronBallman C++17 and later mark all of these constructor calls as _non_-elidable after ignoring the implicit casts, while C++14 and before mark the constructor that is assigned by `=` as elidable, and hence the warning. Should the constructor also be marked as elidable in C++ 17 and later, or not marked as elidable in C++14 and earlier?

I just looked into the code and now I think it is reasonable to leave the C++14 and earlier behavior alone on the assumption that it's good enough for now and because the C++17 and up changes are an improvement. Whether a constructor is or isn't elidable is complex and there's a fair number of FIXME comments around it, so I don't think we should tie that to this PR.

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


More information about the cfe-commits mailing list