Consider the below code:
#include
int func(){
int a = 0;
return a;
}
int main(){
int result =
Yes a
undergoes lvalue-to-rvalue conversion as part of initializing the result object . (Informally this means the value stored in the memory location named a
is retrieved).
See [dcl.init]/17.8:
Otherwise, the initial value of the object being initialized is the (possibly converted) value of the initializer expression. Standard conversions (Clause 7) will be used, if necessary, to convert the initializer expression to the cv-unqualified version of the destination type; no user-defined conversions are considered.
The Clause 7 includes the lvalue-to-rvalue conversion.