This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
Regression from 3.0
- From: Theodore Papadopoulo <Theodore dot Papadopoulo at sophia dot inria dot fr>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Tue, 07 May 2002 19:35:12 +0200
- Subject: Regression from 3.0
For information, I have just filed a gnat report for a regression of
3.2 with respect to 3.0 and 2.95. I do not know what happens with
3.1, so someone may want to give the code a try. It is maybe too late
for being corrected in 3.1, but just in case I wanted you to know.
The minimal test case is:
// Build don't link:
// Origin: Theodore Papadopoulo <Theodore.Papadopoulo@sophia.inria.fr>
struct A {
struct H {
A& a;
H(A& b): a(b) { }
virtual operator int() const = 0;
};
struct R: public H {
R(A& a):H(a) { }
operator int() const { return 1; }
};
R r() { return R(*this); }
};
int
main()
{
A a;
int i = a.r();
}
The program above does not compile with gcc version 3.2 20020424,
whereas it is a conforming one in my opinion.
vanuatu->g++ toto.C
toto.C: In copy constructor `A::H::H(const A::H&)':
toto.C:13: `const' qualifiers cannot be applied to `A&'
--------------------------------------------------------------------
Theodore Papadopoulo
Email: Theodore.Papadopoulo@sophia.inria.fr Tel: (33) 04 92 38 76 01
--------------------------------------------------------------------