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 256811 - CodeAssistant, C++: evauate sizeof(instance_member) expression in static context if it's constant
Summary: CodeAssistant, C++: evauate sizeof(instance_member) expression in static cont...
Status: NEW
Alias: None
Product: cnd
Classification: Unclassified
Component: Code Model (show other bugs)
Version: 8.1
Hardware: PC Linux
: P3 normal (vote)
Assignee: petrk
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2015-11-26 13:18 UTC by jani9876
Modified: 2016-07-19 15:31 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 jani9876 2015-11-26 13:18:08 UTC
Product Version = NetBeans IDE 8.1 (Build 201510222201)
Operating System = Linux version 4.2.0-18-generic running on amd64
Java; VM; Vendor = 1.7.0_85
Runtime = OpenJDK 64-Bit Server VM 24.85-b03

Reproducibility: Happens every time

STEPS:
  * Create a (remote) C++ project
  * add the following union:
    union Fields
      {
         struct
         {
            DictField *REG, *OWN, *DEPDLY, *ARVDLY, *CXX, *SRCSP;
         } fields;
         DictField* all[sizeof(fields) / sizeof(DictField*)];

         static int getFieldCount() { return sizeof(all) / sizeof(all[0]); }
      };

ACTUAL:
  Code assistant says (for sizeof(all) and sizeof(all[0])): Unable to resolve identifier 'all'

EXPECTED:
  In a sizeof expression don't bother whether the referenced field is static or not if its sizeof is constant