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 141800 - Usage of enumerators in array dimension (or static const initializer) within class is unresolved
Summary: Usage of enumerators in array dimension (or static const initializer) within ...
Status: RESOLVED FIXED
Alias: None
Product: cnd
Classification: Unclassified
Component: Code Model (show other bugs)
Version: 6.x
Hardware: All All
: P4 blocker (vote)
Assignee: Leonid Lenyashin
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2008-07-27 04:45 UTC by Vladimir Kvashin
Modified: 2010-05-21 06:32 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 Kvashin 2008-07-27 04:45:50 UTC
In the example below, some usages of TINY are unresolved
(see comments)

enum dimension {
    TINY = 10, SMALL = 100, LARGE = 1000, HUGE = 10000
};

class use_dimension_1 {
    int f;
    int data_1[TINY]; // unresolved
    use_dimension_1() : f(TINY) {} // ok
    use_dimension_1(int);
    static const int F2 = TINY; // unresolved
};


use_dimension_1::use_dimension_1(int) : f(TINY) {} // ok

void use_dimension_2() {
    int data_1[TINY]; // ok
}
Comment 1 Vladimir Kvashin 2008-07-27 04:46:57 UTC
The same is correct when used in namespace

namespace test {

    enum dimension {
        TINY = 10, SMALL = 100, LARGE = 1000, HUGE = 10000
    };

    class use_dimension_3 {
        int f;
        int data_1[TINY]; // unresolved
        use_dimension_3() : f(TINY) {} // ok
        use_dimension_3(int);
        static const int F2 = TINY; // unresolved
    };
    use_dimension_3::use_dimension_3(int) : f(TINY) {} // ok

    void use_dimension_4() {
        int data_1[TINY]; // ok
        int data_2[test::TINY]; // ok
    }
    static const int C = TINY; // ok
}
Comment 2 Alexander Simon 2010-05-21 06:32:30 UTC
already fixed in NB6.9