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 dealii dot org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 10 Jul 2008 03:38:52 -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 #15 from bangerth at dealii dot org 2008-07-10 03:38 -------
(In reply to comment #11)
> 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'.
This issue has now been addressed with the most recent patch for PR 36760.
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=30601