This Bugzilla instance is a read-only archive of historic NetBeans bug reports. To report a bug in NetBeans please follow the project's instructions for reporting issues.

Bug 77432 - Parser fails on function's cast
Summary: Parser fails on function's cast
Status: CLOSED FIXED
Alias: None
Product: cnd
Classification: Unclassified
Component: Code Model (show other bugs)
Version: 5.x
Hardware: All All
: P2 blocker (vote)
Assignee: Vladimir Voskresensky
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2006-06-06 12:49 UTC by Vladimir Voskresensky
Modified: 2008-01-30 18:48 UTC (History)
0 users

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Vladimir Voskresensky 2006-06-06 12:49:54 UTC
testcase:
double val(my_bool *null_value)
{
    void (*func)(UDF_INIT *, uchar *, uchar *)=
    (void (*)(UDF_INIT *, uchar *, uchar *)) u_d->func_clear;
    func(&initid, &is_null, &error);

double (*funcD)(UDF_INIT *, UDF_ARGS *, uchar *, uchar *)=
  (double (*)(UDF_INIT *, UDF_ARGS *, uchar *, uchar *)) u_d->func;
double tmpD=funcD(&initid, &f_args, &is_null, &error);

    longlong (*funcL)(UDF_INIT *, UDF_ARGS *, uchar *, uchar *)=
      (longlong (*)(UDF_INIT *, UDF_ARGS *, uchar *, uchar *)) u_d->func;
    longlong tmpL=funcL(&initid, &f_args, &is_null, &error);
return tmpD + tmpL;
}

parser errors:
test.cpp:4:12: unexpected token: *
test.cpp:4:25: unexpected token: ,
test.cpp:4:34: unexpected token: ,
test.cpp:4:43: unexpected token: )
test.cpp:4:46: unexpected token: u_d
test.cpp:4:61: expecting RPAREN, found ';'
test.cpp:8:12: unexpected token: *
test.cpp:8:25: unexpected token: ,
test.cpp:8:37: unexpected token: ,
test.cpp:8:46: unexpected token: ,
test.cpp:8:55: unexpected token: )
test.cpp:8:58: unexpected token: u_d
test.cpp:8:67: expecting RPAREN, found ';'
test.cpp:12:18: unexpected token: *
test.cpp:12:31: unexpected token: ,
test.cpp:12:43: unexpected token: ,
test.cpp:12:52: unexpected token: ,
test.cpp:12:61: unexpected token: )
test.cpp:12:64: unexpected token: u_d
test.cpp:12:73: expecting RPAREN, found ';'
Comment 1 Vladimir Voskresensky 2007-07-11 06:29:42 UTC
fixed:
- handle function type as cast type (new AST node CSM_FUN_TYPE_CAST_EXPRESSION) 
+ tests

cvs log:
Checking in cppparser.g;
/cvs/cnd/modelimpl/src/org/netbeans/modules/cnd/modelimpl/parser/cppparser.g,v  <--  cppparser.g
new revision: 1.1.2.11.4.19; previous revision: 1.1.2.11.4.18
done