std::list<int> foo();

$ g++ error.cpp
error.cpp:2: error: expected constructor, destructor, or type conversion before 
'<' token

This is missleading as mostly the case is that 'list' is just not declared.
I guess the issue should be handled similar to the case that the declaration 
would be in a function scope (when the error message is sane). However quick 
and 
not so good fix is also possible directly to parser (I experimented a bit and 
was able to have error message that is a bit clearer).

This particular error message have been after the new parser was introduced, 
the 
old error message was even worse.

Mikael

-- 
           Summary: missleading error message with undeclared template name
           Product: gcc
           Version: 4.0.0
            Status: UNCONFIRMED
          Severity: enhancement
          Priority: P2
         Component: c++
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: belz at kolumbus dot fi
                CC: gcc-bugs at gcc dot gnu dot org


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

Reply via email to