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]
Other format: [Raw text]

[Bug c++/43275] New: Unclear error message


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


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