This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c++/43275] New: Unclear error message
- From: "kai dot extern at googlemail dot com" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 6 Mar 2010 15:18:30 -0000
- Subject: [Bug c++/43275] New: Unclear error message
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
This error message:
error: type 'type1' is not derived from 'type2'
is rather unclear. The first reaction is to look at the source, see that
indeed, type1 is not derived from type2, and say "... and why does that
matter?!"
Source:
template < typename A > struct B {
typedef int C;
};
template < typename A > struct D {
struct E {
B < A >::C f;
};
};
6: error: type 'B<A>' is not derived from type 'D<A>::E'
6: error: expected ';' before 'f'
The problem here is that there should be a 'typename' before 'B<A>::C', but the
error message contains no hint of that, in addition to missing any hint of why
the compiler would expect a derived type here anyway.
--
Summary: Unclear error message
Product: gcc
Version: 4.4.1
Status: UNCONFIRMED
Severity: enhancement
Priority: P3
Component: c++
AssignedTo: unassigned at gcc dot gnu dot org
ReportedBy: kai dot extern at googlemail dot com
GCC build triplet: x86_64-linux-gnu
GCC host triplet: x86_64-linux-gnu
GCC target triplet: x86_64-linux-gnu
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=43275