1 // PR c++/18177
2 
foo()3 void foo()
4 {
5   X; // { dg-error "" }
6   const_cast<int&>(X);
7 }
8