This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c++/18313] Missing warning for superfluous const's in return types
- From: "bangerth at dealii dot org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 26 Jan 2007 23:01:11 -0000
- Subject: [Bug c++/18313] Missing warning for superfluous const's in return types
- References: <bug-18313-1771@http.gcc.gnu.org/bugzilla/>
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
------- Comment #6 from bangerth at dealii dot org 2007-01-26 23:01 -------
Hm, I'm not sure if I like this situation. Consider this snippet,
typical of template games:
---------------
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.
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=18313