[C++] regression between 2.95.2 and current
Theodore Papadopoulo
Theodore.Papadopoulo@sophia.inria.fr
Tue Jan 18 04:59:00 GMT 2000
The following code used to compile with g++-2.95.2 and does not
compile with version 2.96 20000109. The culprit of the problem seems
to be the const in the parameter definition of operator<<.
Theo.
mururoa->cat IOendl.C
// Build don't link:
// Origin: Theo Papadopoulo <Theodore.Papadopoulo@sophia.inria.fr>
#include <iostream>
struct A {
A() { }
template <class T>
A& operator<<(const T& t) { cerr << t; return *this; }
};
void
f() {
A mcout;
mcout << endl;
}
mururoa->g++ -v
Reading specs from /net/home/robotvis/gnu/egcs/lib/gcc-lib/i686-pc-linux-gnu/2.96/specs
gcc version 2.96 20000109 (experimental)
mururoa->g++ -c IOendl.C
IOendl.C: In function `void f ()':
IOendl.C:15: no match for `A & << ostream &(&) (ostream &)'
mururoa->/usr/local/bin/g++ -v
Reading specs from /usr/local/gcc/lib/gcc-lib/i686-pc-linux-gnu/2.95.2/specs
gcc version 2.95.2 19991024 (release)
mururoa->/usr/local/bin/g++ -c IOendl.C
mururoa->
--------------------------------------------------------------------
Theodore Papadopoulo
Email: Theodore.Papadopoulo@sophia.inria.fr Tel: (33) 04 92 38 76 01
--------------------------------------------------------------------
More information about the Gcc-bugs
mailing list