------- Comment #13 from mark at codesourcery dot com  2008-07-09 19:08 -------
Subject: Re:  Simple std::bind use causes warnings with -Wextra

bangerth at dealii dot org wrote:
> ------- Comment #10 from bangerth at dealii dot org  2008-07-09 17:04 -------
> (In reply to comment #8)
>> I was also trying to raise the issue of whether we think the warning is 
>> useful.
>>  If it's not practical to avoid the warning in the library, then I wonder if
>> it's practical to avoid it other generic-programming code.
> 
> I agree with this. As I mentioned in PR 30601, code like this
> 
>   template <typename T> class ArrayView {
>     T& operator();
>     T operator() const;
>   };
> 
> is quite common and I don't see a need to make it more complicated than
> necessary just for a warning.

Me neither.  I think writing:

   const int f();

or:

   template <typename T>
   const int f(T);

is probably worth warning about, but maybe we ought to just skip this 
warning when instantiating a template function.  In other words, warn at 
the point of original declaration of the template if it is already 
obviously meaningless at that point to add the cv-qualifier, but not 
warn at instantiation.


-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=36760

Reply via email to