This:
#include    <cstdlib>

class system { system() {} };
int foo(system* p) {}


gets you:
~/ootbc/systemspec/build$ g++ foo.cc
foo.cc:4: error: 'p' was not declared in this scope
foo.cc:4: error: expected ',' or ';' before '{' token

The problem is that the function int system(...) is in scope so "system" on
line 4 is not recognized as a type and I guess the compiler is trying to parse
it as an expression (with "*" as the multiply operator). However, there's no
language construction "<type> <identifier> (<expression>)" that I know of.


-- 
           Summary: bad diagnostic
           Product: gcc
           Version: 4.1.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         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=32966

Reply via email to