This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c++/30601] [4.3 regression] -Wreturn-type warns about more than what the documentation says
- From: "bangerth at math dot tamu dot edu" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 26 Jan 2007 22:59:27 -0000
- Subject: [Bug c++/30601] [4.3 regression] -Wreturn-type warns about more than what the documentation says
- References: <bug-30601-102@http.gcc.gnu.org/bugzilla/>
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
------- Comment #11 from bangerth at math dot tamu dot edu 2007-01-26 22:59 -------
Subject: Re: [4.3 regression] -Wreturn-type warns about more
than what the documentation says
> I think this was done on purpose.
It is contrary to what the documentation says. I think it also doesn't
make much sense in C++ if the return type results from a template
substitution. For example, the following case is rather common:
template <typename T> class Array {
T& operator();
T operator() const;
};
This class will trigger a warning if instantiated as Array<const double>
because the return type of the second operator() is now 'const double'.
W.
-------------------------------------------------------------------------
Wolfgang Bangerth email: bangerth@math.tamu.edu
www: http://www.math.tamu.edu/~bangerth/
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=30601