int foo = foo; compiles.
Which part of the C++ standard allows this?
int foo = foo; compiles. Which part of the C++ standard allows this?
Share
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
The behaviour is well defined if the declaration is at file scope. If you have the declaration at function scope and if you use
foolater on [which would be initialized to some unspecified value in that case] the behaviour would be undefined.