prog.cpp: In function ‘int main()’:
prog.cpp:12:14: error: ‘const’ qualifiers cannot be applied to ‘int&’
int & const w = obj ; // illegal
^
prog.cpp:3:8: warning: unused variable ‘p’ [-Wunused-variable]
int * p; // p is a pointer to int.
^
prog.cpp:4:13: warning: unused variable ‘q’ [-Wunused-variable]
const int* q; // q is a pointer to const int.
^
prog.cpp:5:13: warning: unused variable ‘r’ [-Wunused-variable]
int const* r; // r is a pointer to const int.
^
prog.cpp:6:14: warning: unused variable ‘s’ [-Wunused-variable]
int * const s = nullptr; // s is a const pointer to int
^
prog.cpp:9:8: warning: unused variable ‘t’ [-Wunused-variable]
int & t = obj ; // t is a reference to int
^
prog.cpp:10:14: warning: unused variable ‘u’ [-Wunused-variable]
const int & u = obj ; // u is a reference to const int
^
prog.cpp:11:13: warning: unused variable ‘v’ [-Wunused-variable]
int const& v = obj ; // v is a reference to const int
^
prog.cpp:12:14: warning: unused variable ‘w’ [-Wunused-variable]
int & const w = obj ; // illegal
^