Skip to content

Commit

Permalink
Require '{', ';', or '=' after a function type.
Browse files Browse the repository at this point in the history
Fixes part of SF#532.
  • Loading branch information
bengardner committed Jun 6, 2013
1 parent 6bc7723 commit a5ecb47
Showing 1 changed file with 14 additions and 1 deletion.
15 changes: 14 additions & 1 deletion src/combine.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1221,7 +1221,20 @@ static bool mark_function_type(chunk_t *pc)
goto nogo_exit;
}
aft = chunk_get_next_ncnl(apc);
pt = chunk_is_token(aft, CT_BRACE_OPEN) ? CT_FUNC_DEF : CT_FUNC_PROTO;
if (chunk_is_token(aft, CT_BRACE_OPEN))
{
pt = CT_FUNC_DEF;
}
else if (chunk_is_token(aft, CT_SEMICOLON) ||
chunk_is_token(aft, CT_ASSIGN))
{
pt = CT_FUNC_PROTO;
}
else
{
LOG_FMT(LFTYPE, "%s: not followed by '{' or ';'\n", __func__);
goto nogo_exit;
}
ptp = (pc->flags & PCF_IN_TYPEDEF) ? CT_FUNC_TYPE : CT_FUNC_VAR;

tmp = pc;
Expand Down

0 comments on commit a5ecb47

Please sign in to comment.