Determining whether an expression statement induces a side effect or not in general cannot be done at conpile time. Even calling function is not necessarily a side effect.
The major point is that a discarded value expression... discards its value. I guess the description is intended to say "an expression only appears for its potential side effects".
But if I were to really split hairs, note that it says "such an expression is called a discarded-value expression". It does not say "Some expressions are discarded-value expressions. Such expressions only appear for their side effects".
The point of the classification is an introduction of a temporary in the first place. Otherwise prvalues would be without a result object.
Determining whether an expression statement induces a side effect or not in general cannot be done at conpile time. Even calling function is not necessarily a side effect.
The major point is that a discarded value expression... discards its value. I guess the description is intended to say "an expression only appears for its potential side effects".
But if I were to really split hairs, note that it says "such an expression is called a discarded-value expression". It does not say "Some expressions are discarded-value expressions. Such expressions only appear for their side effects".
The point of the classification is an introduction of a temporary in the first place. Otherwise prvalues would be without a result object.