[Bug c++/12796] New: Wrong line number in error message

reichelt at gcc dot gnu dot org gcc-bugzilla@gcc.gnu.org
Mon Oct 27 22:02:00 GMT 2003


PLEASE REPLY TO gcc-bugzilla@gcc.gnu.org ONLY, *NOT* gcc-bugs@gcc.gnu.org.

http://gcc.gnu.org/bugzilla/show_bug.cgi?id=12796

           Summary: Wrong line number in error message
           Product: gcc
           Version: 3.4
            Status: UNCONFIRMED
          Keywords: diagnostic
          Severity: normal
          Priority: P2
         Component: c++
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: reichelt at gcc dot gnu dot org
                CC: gcc-bugs at gcc dot gnu dot org

Compiling the following code snippet

=========================================
struct A {};

struct B
{
    int i;
    A::X;
};
=========================================

causes the following error message:

bug.cc:4: error: type `B' is not a base type for type `A'

However, the bug is in line 6 and not in line 4.
This affects all versions of gcc.
Well, 2.95.x reports a different line, namely 7, which is also incorrect.



More information about the Gcc-bugs mailing list