The warning below is unhelpful in generic code and silencing it by removing the top-level cv qualifiers is unnecessarily tedious. $ cat t.cpp && g++ t.cpp -W template <class T> T foo () { return T (); } int main () { foo<const int>(); } t.cpp: In function 'int main()': t.cpp:2: warning: type qualifiers ignored on function return type
*** This bug has been marked as a duplicate of 36052 ***