int g_nn; int& g_n __attribute__((deprecated)) = g_nn; int main() { g_n = 1; } Compile with -Wall No any warning.
Tested on gcc 4.1.2 4.5.3 4.6.3 4.7.2
Mine.
Fixed for 4.9.0 (r201906)