http://gcc.gnu.org/bugzilla/show_bug.cgi?id=50785
--- Comment #11 from trashyankes at wp dot pl 2011-10-19 16:35:06 UTC --- it will be possible to add better waring/error in this case? is complicity misleading when you use `static const` or `static constexpr` for long time and when you try get ref that value you get error. its get very weird when you have two lines that use it and only one give error. code: struct test { static const int z = 6; static constexpr double t = 0.001; }; template<class T> T ref(const T& i) { return i; } template<class T> T value(const T i) { return i; } int main() { value(test::z); value(test::t); ref(test::z); //error ref(test::t); //error } until today i thought this code is correct. maybe some info when you try take ref from const static objects?