This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
Misleading typo in C++ error
- To: <gcc-bugs at gcc dot gnu dot org>
- Subject: Misleading typo in C++ error
- From: "Peter Bienstman" <Peter dot Bienstman at rug dot ac dot be>
- Date: Wed, 26 Jan 2000 15:39:20 +0100
Hi,
Compiling the following snippet (2.95.2)
class A {};
class B : public A {};
void f(const A& a)
{
dynamic_cast<B*>(&a);
const A a2;
dynamic_cast<B*>(&a2);
}
leads to
error.cpp: In function `void f(const A &)':
error.cpp:6: cannot dynamic_cast `+a' (of type `const class A *') to type
`class B*'
error.cpp:8: uninitialized const `a2'
error.cpp:9: cannot dynamic_cast `&a2' (of type `const class A *') to type
`class B*'
I suppose the error message on line 6 should print '&a' instead of `+a',
just as it does on line 9?
Peter
-------------------------------------
Peter Bienstman
Department of Information Technology
INTEC/IMEC - University of Gent
St.-Pietersnieuwstraat 41
B-9000 Gent - Belgium
E-mail: Peter.Bienstman@rug.ac.be
Tel: +32 9 264 3445
Fax: +32 9 264 3593
-------------------------------------