Subject: Bug#358050: line number in extra qualification error not ideal (end of declaration)

From: Martin Michlmayr <[email-masked]>
Date: Mon, 20 Mar 2006 23:34:49 +0000

Package: g++-4.1
Version: 4.1.0-0
Severity: minor

The line number mentioned in the "extra qualification" error is not
ideal.  Instead of showing the line number on which the extra
qualification actually occurs, or should the last line of the
declaration.

(sid)6102:tbm@deprecation: ~] cat > test.cpp
class foo {
    foo::foo(int a,
             int b,
             int c);
};

int main() {
}
(sid)6103:tbm@deprecation: ~] g++ test.cpp
test.cpp:4: error: extra qualification ‘foo::’ on member ‘foo’

I'd like to see "test.cpp:2: ..." here.

Presumably it checks things like that after reading a complete
declaration.  I would have thought it could track what the first line
of the declaration was though.

-- System Information:
Debian Release: testing/unstable
  APT prefers testing
  APT policy: (500, 'testing')
Architecture: i386 (i686)
Shell:  /bin/sh linked to /bin/bash
Kernel: Linux 2.6.16-rc5-486
Locale: LANG=en_US.UTF-8, LC_CTYPE=en_US.UTF-8 (charmap=UTF-8)

-- 
Martin Michlmayr
http://www.cyrius.com/