(Inspired by this question which is unfortunately subjective).
Which factors affect whether a compiler chooses to apply (N)VRO?
I know there are two broad categories of factors as the optimizer needs to answer two questions about the (N)VRO decision: (1) Is it even possible and (2) is it an optimization ? I expect each factor to apply to just one of those two questions.
Please, no unfounded speculation on the optimization part. It's OK to list a factor when you can explain exactly how it affects optimization, or a factor that's used by an existing compiler. But don't say sizeof(T)
without explaining how that affects the decision to apply (N)VRO.