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 142578 - IDE doesn't highlight wrong code (semicolon is missed)
Summary: IDE doesn't highlight wrong code (semicolon is missed)
Status: NEW
Alias: None
Product: cnd
Classification: Unclassified
Component: Code Model (show other bugs)
Version: 6.x
Hardware: All All
: P4 blocker (vote)
Assignee: issues@cnd
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2008-08-01 13:58 UTC by soldatov
Modified: 2013-05-07 11:21 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 soldatov 2008-08-01 13:58:39 UTC
This code has missed semicolon (in 'int amount =' line), but IDE highlights this code as wrong:

#include <iostream>

using namespace std;

int readNumberOf(const char* item, int min, int max) {
    cout << "Enter number of " << item << " (" << min << " <= N <= " << max << "): ";

    string s;
    getline(cin, s);
    int amount = strtol(s.c_str(), 0, 10)

    cout << endl;

    if (amount < min) {
        cout << "number of " << item << " cannot be less than " << min << '.' << endl;
        cout << min << " item is taken" << endl << endl;

        amount = min;
    } else if (amount > max) {
        cout << "number of " << item << " cannot be more than " << max << '.' << endl;
        cout << max << " items is taken" << endl << endl;

        amount = max;
    }

    return amount;
}
Comment 1 soldatov 2008-08-06 09:48:27 UTC
Other testcase:
int f() {
    return 0;
}

int main(int argc, char**argv) {
    int i;
    i = i + 1
    f();
    return 0;
}
Comment 2 Vladimir Kvashin 2008-08-28 17:17:40 UTC
For now, error highlighting does not claim that it shows *all* errors.
This *is* an issue, but I believe it does not deserve more than P4.
Comment 3 Alexander Simon 2010-05-21 06:35:01 UTC
still reproduced