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]

Re: [C++] regression between 2.95.2 and current



  #include <iostream>

  struct A {
	  A() { }
	  template <class T>
	  A& operator<<(const T& t) { cerr << t; return *this; }
  };

  void
  f() {
	  A mcout;	
	  mcout << endl;
  }

G++ is correct to reject this program.  It involves creating a
cv-qualified function type, and that causes template deduction to
fail.

--
Mark Mitchell                   mark@codesourcery.com
CodeSourcery, LLC               http://www.codesourcery.com

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