This is the mail archive of the gcc-bugs@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]

[Bug c++/18313] Missing warning for superfluous const's in return types



------- 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


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