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 198276 - Static keyword on local variables
Summary: Static keyword on local variables
Status: REOPENED
Alias: None
Product: cnd
Classification: Unclassified
Component: Code Model (show other bugs)
Version: 7.0
Hardware: PC Linux
: P4 normal (vote)
Assignee: issues@cnd
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2011-05-03 10:27 UTC by thyplosion
Modified: 2014-11-21 13:40 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 thyplosion 2011-05-03 10:27:24 UTC
Defining a static variable on a function is not recognized by the editor and an error is issued: "unexpected token static".

ie:

void func()
{
static int localstatic;
}
Comment 1 Alexander Simon 2011-05-03 20:16:16 UTC
Bug is not reproduced on your code example.
It seems error is appeared in previous lines.
Please provide minimal code that has such error.
Comment 2 thyplosion 2011-05-04 08:48:48 UTC
Actually, the error was something else. The real erroneous code is "static var" instead of "static int var". It is the absence of "int" that triggers the error message.

void func()
{
	static catchme = 0;
}

Apologies for having missed this; gcc accepts the code as default "int" type hence I didn't realise the missing keyword.
Comment 3 nnnnnk 2011-05-06 10:16:35 UTC
CSS 4.5.2 says:
main.cpp:14:13: error: ‘catchme’ does not name a type