template<typename T> class foo;

template<>
struct foo<int> { static const int u = 0; static int v; };

const int foo<int>::u;

const int foo<int>::u;

int foo<int>::v;

int foo<int>::v;


gets you:

~/ootbc/members/src$ g++ foo.cc
foo.cc:8: error: redefinition of `const int foo<int>::u'
foo.cc:4: error: `const int foo<int>::u' previously defined here
foo.cc:12: error: redefinition of `int foo<int>::v'
foo.cc:10: error: `int foo<int>::v' previously declared here

The diagnostic for line 8 should refer to line 6, not line 4. Note that the
problem only occurs with the 'const' case because the diagnostic for line 12
correctly refers to line 10.


-- 
           Summary: Wrong line number in diagnostic
           Product: gcc
           Version: 3.4.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P2
         Component: c++
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: igodard at pacbell dot net


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

Reply via email to