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: PING: [PATCH: c++/diagnostic/18313] Warn for pointless qualifiers on return type


On Monday, 27. November 2006 03:23, Gabriel Dos Reis wrote:

> |         * pt.c (tsubst_function_type): Warn for type qualifiers on
> |         return type for dependent types.
> This ChangeLog entry seems to indicate that we warn even for dependent
> type, when in fact I was suggesting to warn only for non-dependent type.

We're warning for the non-dependent case, e.g. for this:

template<typename T> struct S {
  const int f() const;
  const T g() const;
  T h() const;
};

we will only warn for f() in the "normal" case. if the instantiation has a cv 
qualifier, we will warn on h() as well (but not on g()). As far as I 
understood, this was the consensus. 

If you have a better way to describe this behaviour, please tell me. I'd also 
be interested if the TREE_NO_WARNING on the type node has any undesired 
side-effect (there was none exposed by the testsuite). 


Thanks,
Dirk


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