This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [PATCH] Fix PR c++/40749: g++ doesnt report missing return if return is of type const <type>


On 07/17/2009 06:02 PM, Simon Martin wrote:
This is due to the fix for PR#18313, that sets TREE_NO_WARNING on any
function with a qualified return type. The attached patch does not do
it, which solves the PR (the test suite does not contain any test that
proves that setting TREE_NO_WARNING was necessary...)

I think the TREE_NO_WARNING bit is to avoid double warnings on code like


template <class T>
const int f(T t) { return 0; }

but clearly TREE_NO_WARNING is too big a hammer to use for that. I think the right answer is just to remove the tsubst_function_type hunk from the 18313 fix entirely; I don't think it's useful to warn when substituting into a template happens to produce a const-qualified return type. Could you do that as well?

Jason


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]